A class that performs work synchronously on a background thread provided by
Worker classes are instantiated at runtime by WorkManager and the
doWork() method is
called on a pre-specified background thread (see
method is for synchronous processing of your work, meaning that once you return from that
method, the Worker is considered to be finished and will be destroyed. If you need to do your
work asynchronously or call asynchronous APIs, you should use
In case the work is preempted for any reason, the same instance of Worker is not reused. This
doWork() is called exactly once per Worker instance. A new Worker is created
if a unit of work needs to be rerun.
A Worker is given a maximum of ten minutes to finish its execution and return a
ListenableWorker.Result. After this time has expired, the Worker will be
signalled to stop.
Override this method to do your actual background processing.
Override this method to start your actual background processing.