ProgressToken

interface ProgressToken<T>

Functions

cancel
Link copied to clipboard
abstract fun cancel()
Cancels the progress if it has not finished yet.
getCompletionStage
Link copied to clipboard
abstract fun getCompletionStage(): CompletionStage<T>
Gets the already started CompletionStage which completes with the result.
isCancelled
Link copied to clipboard
abstract fun isCancelled(): Boolean
Is the progress cancelled or not.
onException
Link copied to clipboard
abstract fun onException(exception: Consumer<Throwable>): ProgressToken<T>
Adds a new consumer to the progressToken which gets called if the the progress fails with an exception.
onProgress
Link copied to clipboard
abstract fun onProgress(progress: Consumer<Double>): ProgressToken<T>
Adds a new consumer to the progressToken which gets called each time the progress percentage from 0.0(0%) to 1.0 (100%) changes.
onResult
Link copied to clipboard
abstract fun onResult(result: Consumer<T>): ProgressToken<T>
Adds a new consumer to the progressToken which gets called once the the progress completes.