ProgressiveOutcome
A Outcome with integrated Progress management.
There are three possible cases:
Incomplete if the task has started but no value is currently available,
Success if a successful result is available (see Success.value),
Failure if a failed result is available (see Failure.failure).
Note that in cases, a progressive outcome may be currently loading.
Incomplete must be loading,
Success may be loading if the task is currently querying a newer value than the one it stores,
Failure may be loading if the task is currently retrying the operation.
To access the inner outcome and progression, you can use the destructuring operator:
val (out, progression) = /* ProgressiveOutcome */
To create progressive outcomes from computations, use the successfulWithProgress and failedWithProgress factories.
Inheritors
Types
The operation is ongoing, but we do not know if it will be successful or a failure.
Operations that are not successful; common supertype of Incomplete and Failure.
Properties
Returns Failure.failure.
Returns Failure.failure, or null
if this outcome is not a failure.
Returns Success.value.
Returns Success.value, or null
if this outcome is not successful.
Functions
Syntax sugar for asOutcome.
Syntax sugar for ProgressiveOutcome.progress.
Replaces the progress information from this progressive outcome.
Converts a ProgressiveOutcome into a Progressive.
If this outcome is successful, replaces its value using transform.
If this outcome is failed, replaces its failure using transformFailure.
Executes block if this outcome is incomplete.
Executes block if this outcome is loading (its ProgressiveOutcome.progress is Progress.Loading).
Executes block if this outcome is successful.