RemoteWorkContinuation

public abstract class RemoteWorkContinuation


Provides a subset of androidx.work.WorkContinuation APIs that are available for apps that use multiple processes.

Summary

Public methods

static @NonNull RemoteWorkContinuation

Combines multiple RemoteWorkContinuations as prerequisites for a new RemoteWorkContinuation to allow for complex chaining.

abstract @NonNull ListenableFuture<Void>

Enqueues the instance of RemoteWorkContinuation on the background thread.

abstract @NonNull RemoteWorkContinuation

Adds new OneTimeWorkRequest items that depend on the successful completion of all previously added OneTimeWorkRequests.

final @NonNull RemoteWorkContinuation

Adds new OneTimeWorkRequest items that depend on the successful completion of all previously added OneTimeWorkRequests.

Public methods

combine

Added in 2.5.0
public static @NonNull RemoteWorkContinuation combine(@NonNull List<RemoteWorkContinuation> continuations)

Combines multiple RemoteWorkContinuations as prerequisites for a new RemoteWorkContinuation to allow for complex chaining.

Parameters
@NonNull List<RemoteWorkContinuation> continuations

One or more RemoteWorkContinuations that are prerequisites for the return value

Returns
@NonNull RemoteWorkContinuation

A RemoteWorkContinuation that allows further chaining

enqueue

Added in 2.5.0
public abstract @NonNull ListenableFuture<Voidenqueue()

Enqueues the instance of RemoteWorkContinuation on the background thread.

Returns
@NonNull ListenableFuture<Void>

An ListenableFuture that can be used to determine when the enqueue has completed

then

Added in 2.5.0
public abstract @NonNull RemoteWorkContinuation then(@NonNull List<OneTimeWorkRequest> work)

Adds new OneTimeWorkRequest items that depend on the successful completion of all previously added OneTimeWorkRequests.

Parameters
@NonNull List<OneTimeWorkRequest> work

One or more OneTimeWorkRequest to add as dependents

Returns
@NonNull RemoteWorkContinuation

A RemoteWorkContinuation that allows for further chaining of dependent OneTimeWorkRequests

then

Added in 2.5.0
public final @NonNull RemoteWorkContinuation then(@NonNull OneTimeWorkRequest work)

Adds new OneTimeWorkRequest items that depend on the successful completion of all previously added OneTimeWorkRequests.

Parameters
@NonNull OneTimeWorkRequest work

One or more OneTimeWorkRequests to add as dependents

Returns
@NonNull RemoteWorkContinuation

A RemoteWorkContinuation that allows for further chaining of dependent OneTimeWorkRequests