ListenableWorker.Result
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 functions |
|
|---|---|
java-static ListenableWorker.Result |
failure()Returns an instance of |
java-static ListenableWorker.Result |
Returns an instance of |
abstract Data |
|
java-static ListenableWorker.Result |
retry()Returns an instance of |
java-static ListenableWorker.Result |
success()Returns an instance of |
java-static ListenableWorker.Result |
Returns an instance of |
Public functions
failure
java-static fun failure(): ListenableWorker.Result
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 | |
|---|---|
ListenableWorker.Result |
An instance of |
failure
java-static fun failure(outputData: Data): ListenableWorker.Result
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 | |
|---|---|
ListenableWorker.Result |
An instance of |
getOutputData
abstract fun getOutputData(): Data
| Returns | |
|---|---|
Data |
The output |
retry
java-static fun retry(): ListenableWorker.Result
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 | |
|---|---|
ListenableWorker.Result |
An instance of |
success
java-static fun success(): ListenableWorker.Result
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 | |
|---|---|
ListenableWorker.Result |
An instance of |
success
java-static fun success(outputData: Data): ListenableWorker.Result
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 | |
|---|---|
outputData: Data |
A |
| Returns | |
|---|---|
ListenableWorker.Result |
An instance of |