Task
Represents the result of an asynchronous operation.
Types
Link copied to clipboard
interface UnobservedExceptionHandler
Interface for handlers invoked when a failed
Task
is about to be finalized, but the exception has not been consumed.Properties
Link copied to clipboard
An java.util.concurrent.Executor that executes tasks in the current thread unless the stack runs too deep, at which point it will delegate to BACKGROUND_EXECUTOR in order to trim the stack.
Link copied to clipboard
An java.util.concurrent.Executor that executes tasks on the UI thread.
Link copied to clipboard
Functions
Link copied to clipboard
open fun <TContinuationResult> continueWith(continuation: Continuation<TResult, TContinuationResult>): Task<TContinuationResult>
Adds a synchronous continuation to this task, returning a new task that completes after the continuation has finished running.
open fun <TContinuationResult> continueWith(continuation: Continuation<TResult, TContinuationResult>, executor: Executor): Task<TContinuationResult>
Adds a continuation that will be scheduled using the executor, returning a new task that completes after the continuation has finished running.
Link copied to clipboard
open fun <TContinuationResult> continueWithTask(continuation: Continuation<TResult, Task<TContinuationResult>>): Task<TContinuationResult>
Adds an asynchronous continuation to this task, returning a new task that completes after the task returned by the continuation has completed.
open fun <TContinuationResult> continueWithTask(continuation: Continuation<TResult, Task<TContinuationResult>>, executor: Executor): Task<TContinuationResult>
Adds an Task-based continuation to this task that will be scheduled using the executor, returning a new task that completes after the task returned by the continuation has completed.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun <TContinuationResult> onSuccess(continuation: Continuation<TResult, TContinuationResult>): Task<TContinuationResult>
Runs a continuation when a task completes successfully, forwarding along s or cancellation.
open fun <TContinuationResult> onSuccess(continuation: Continuation<TResult, TContinuationResult>, executor: Executor): Task<TContinuationResult>
Runs a continuation when a task completes successfully, forwarding along or cancellation.
Link copied to clipboard
open fun <TContinuationResult> onSuccessTask(continuation: Continuation<TResult, Task<TContinuationResult>>): Task<TContinuationResult>
open fun <TContinuationResult> onSuccessTask(continuation: Continuation<TResult, Task<TContinuationResult>>, executor: Executor): Task<TContinuationResult>
Runs a continuation when a task completes successfully, forwarding along s or cancellation.
Link copied to clipboard
Blocks until the task is complete.
Blocks until the task is complete or times out.