Android 12 Developer Preview is here! Try it out, and give us your feedback!


abstract class RxWorker : ListenableWorker

RxJava2 interoperability Worker implementation.

When invoked by the WorkManager, it will call @createWork() to get a Single<Result> subscribe to it.

By default, RxWorker will subscribe on the thread pool that runs WorkManager Workers. You can change this behavior by overriding getBackgroundScheduler() method.

An RxWorker is given a maximum of ten minutes to finish its execution and return a After this time has expired, the worker will be signalled to stop.


Public constructors
<init>(@NonNull appContext: Context, @NonNull workerParams: WorkerParameters)

Public methods
abstract Single<ListenableWorker.Result!>

Override this method to define your actual work and return a Single of which will be subscribed by the WorkManager.

open Unit

setCompletableProgress(@NonNull data: Data)

Updates the progress for a RxWorker.

setProgress(@NonNull data: Data)

Updates the progress for a RxWorker.

open ListenableFuture<ListenableWorker.Result!>

Protected methods
open Scheduler

Returns the default background scheduler that RxWorker will use to subscribe.

Inherited functions

Public constructors


    @NonNull appContext: Context