ListenableWorker.Result
public abstract class ListenableWorker.Result
The result of a ListenableWorker's computation. Call success, failure, or retry or one of their variants to generate an object indicating what happened in your background work.
Summary
Public methods |
|
|---|---|
static @NonNull ListenableWorker.Result |
failure()Returns an instance of |
static @NonNull ListenableWorker.Result |
Returns an instance of |
abstract @NonNull Data |
|
static @NonNull ListenableWorker.Result |
retry()Returns an instance of |
static @NonNull ListenableWorker.Result |
success()Returns an instance of |
static @NonNull ListenableWorker.Result |
Returns an instance of |
Public methods
failure
public static @NonNull ListenableWorker.Result failure()
Returns an instance of Result that can be used to indicate that the work completed with a permanent failure. Any work that depends on this will also be marked as failed and will not be run. If you need child workers to run, you need to use success or success(Data); failure indicates a permanent stoppage of the chain of work.
| Returns | |
|---|---|
@NonNull ListenableWorker.Result |
An instance of |
failure
public static @NonNull ListenableWorker.Result failure(@NonNull Data outputData)
Returns an instance of Result that can be used to indicate that the work completed with a permanent failure. Any work that depends on this will also be marked as failed and will not be run. If you need child workers to run, you need to use success or success(Data); failure indicates a permanent stoppage of the chain of work.
| Parameters | |
|---|---|
@NonNull Data outputData |
A |
| Returns | |
|---|---|
@NonNull ListenableWorker.Result |
An instance of |
getOutputData
public abstract @NonNull Data getOutputData()
| Returns | |
|---|---|
@NonNull Data |
The output |
retry
public static @NonNull ListenableWorker.Result retry()
Returns an instance of Result that can be used to indicate that the work encountered a transient failure and should be retried with backoff specified in setBackoffCriteria.
| Returns | |
|---|---|
@NonNull ListenableWorker.Result |
An instance of |
success
public static @NonNull ListenableWorker.Result success()
Returns an instance of Result that can be used to indicate that the work completed successfully. Any work that depends on this can be executed as long as all of its other dependencies and constraints are met.
| Returns | |
|---|---|
@NonNull ListenableWorker.Result |
An instance of |
success
public static @NonNull ListenableWorker.Result success(@NonNull Data outputData)
Returns an instance of Result that can be used to indicate that the work completed successfully. Any work that depends on this can be executed as long as all of its other dependencies and constraints are met.
| Parameters | |
|---|---|
@NonNull Data outputData |
A |
| Returns | |
|---|---|
@NonNull ListenableWorker.Result |
An instance of |