interface CompletableAsyncResult<T : Any> : AsyncResult<T>
(source)
An AsyncResult that can be later completed successfully with a provided value, or completed with an exception.
- The type of the value returned by this result.
abstract fun complete(value: T?): Boolean
Complete this result with the given value. |
|
abstract fun completeExceptionally(ex: Throwable): Boolean
Complete this result with the given exception. |
abstract fun accept(consumer: BiConsumer<in T, Throwable>): AsyncCompletion
Returns a new completion that, when this result completes either normally or exceptionally, completes after executing the supplied function with this result's value and exception as arguments. Either the value or the exception supplied to the function will be |
|
abstract fun cancel(): Boolean
Attempt to cancel execution of this task. This attempt will fail if the task has already completed, has already been cancelled, or could not be cancelled for some other reason. If successful, and this task has not started when After this method returns, subsequent calls to |
|
abstract fun exceptionally(fn: Function<Throwable, out T>): AsyncResult<T>
Returns a new result that, when this result completes exceptionally, completes with the value obtained from executing the supplied function with this result's exception as an argument. Otherwise, if this result completes normally, then the returned result also completes normally with the same value. |
|
abstract fun get(): T?
Waits if necessary for the computation to complete, and then retrieves its result. abstract fun get(timeout: Long, unit: TimeUnit): T?
Waits if necessary for at most the given time for the computation to complete, and then retrieves its result. |
|
abstract fun <U : Any> handle(fn: BiFunction<in T, Throwable, out U>): AsyncResult<U>
Returns a new result that, when this result completes either normally or exceptionally, completes with the value obtained from executing the supplied function with this result's value and exception as arguments. Either the value or the exception supplied to the function will be |
|
abstract fun isCancelled(): Boolean
Returns |
|
abstract fun isCompletedExceptionally(): Boolean
Returns |
|
abstract fun isDone(): Boolean
Returns |
|
abstract fun <U : Any> then(fn: Function<in T, out AsyncResult<U>>): AsyncResult<U>
Returns a new result that, when this result completes normally, completes with the same value or exception as the result returned after executing the given function with this results value as an argument. |
|
abstract fun thenAccept(consumer: Consumer<in T>): AsyncCompletion
Returns a completion that, when this result completes normally, completes after executing the supplied consumer with this result's value as an argument. |
|
abstract fun <U : Any> thenAcceptBoth(other: AsyncResult<out U>, consumer: BiConsumer<in T, in U>): AsyncCompletion
Returns a completion that, when this result and the other result both complete normally, completes after executing the supplied consumer with both this result's value and the value from the other result as arguments. |
|
abstract fun <U : Any> thenApply(fn: Function<in T, out U>): AsyncResult<U>
Returns a result that, when this result completes normally, completes with the value obtained from executing the supplied function with this result's value as an argument. |
|
abstract fun <U : Any, V : Any> thenCombine(other: AsyncResult<out U>, fn: BiFunction<in T, in U, out V>): AsyncResult<V>
Returns a result that, when this result and the other result both complete normally, completes with the value obtained from executing the supplied function with both this result's value and the value from the other result as arguments. |
|
abstract fun thenCompose(fn: Function<in T, out AsyncCompletion>): AsyncCompletion
When this result completes normally, invokes the given function with the resulting value and obtains a new AsyncCompletion. |
|
abstract fun thenRun(runnable: Runnable): AsyncCompletion
Returns a new completion that, when this result completes normally, completes after given action is executed. |
|
abstract fun <U : Any> thenSchedule(vertx: Vertx, fn: Function<in T, out AsyncResult<U>>): AsyncResult<U>
Returns a new result that, when this result completes normally, completes with the same value or exception as the completion returned after executing the given function on the vertx context with this results value as an argument. |
|
abstract fun <U : Any> thenScheduleApply(vertx: Vertx, fn: Function<in T, out U>): AsyncResult<U>
Returns a result that, when this result completes normally, completes with the value obtained from executing the supplied function on the vertx context with this result's value as an argument. |
|
abstract fun <U : Any> thenScheduleBlockingApply(vertx: Vertx, fn: Function<in T, out U>): AsyncResult<U>
Returns a result that, when this result completes normally, completes with the value obtained from executing the supplied blocking function on the vertx context with this result's value as an argument. abstract fun <U : Any> thenScheduleBlockingApply(executor: WorkerExecutor, fn: Function<in T, out U>): AsyncResult<U>
Returns a result that, when this result completes normally, completes with the value obtained from executing the supplied blocking function on the vertx executor with this result's value as an argument. |
|
abstract fun thenScheduleBlockingRun(vertx: Vertx, runnable: Runnable): AsyncCompletion
Returns a new completion that, when this result completes normally, completes after the given blocking action is executed on the vertx context. abstract fun thenScheduleBlockingRun(executor: WorkerExecutor, runnable: Runnable): AsyncCompletion
Returns a new completion that, when this result completes normally, completes after the given blocking action is executed on the vertx executor. |
|
abstract fun thenScheduleRun(vertx: Vertx, runnable: Runnable): AsyncCompletion
Returns a new completion that, when this result completes normally, completes after the given action is executed on the vertx context. |
|
abstract fun whenComplete(action: BiConsumer<in T, in Throwable>): AsyncResult<T>
Returns a new result that completes with the same value or exception as this result, after executing the given action with this result's value or exception. Either the value or the exception supplied to the action will be |