A Future that may be explicitly completed (setting its value and status), and may be used as a CompletionStage, supporting dependent functions and actions that trigger upon its completion.
When two or more threads attempt to complete, completeExceptionally, or cancel a CompletableFuture, only one of them succeeds.
In addition to these and related methods for directly manipulating status and results, CompletableFuture implements interface CompletionStage with the following policies:
Actions supplied for dependent completions of non-async methods may be performed by the thread that completes the current CompletableFuture, or by any other caller of a completion method.
All async methods without an explicit Executor argument are performed using the ForkJoinPool.commonPool() (unless it does not support a parallelism level of at least two, in which case, a new Thread is created to run each task). To simplify monitoring, debugging, and tracking, all generated asynchronous tasks are instances of the marker interface CompletableFuture.AsynchronousCompletionTask.
All CompletionStage methods are implemented independently of other public methods, so the behavior of one method is not impacted by overrides of others in subclasses.
CompletableFuture also implements Future with the following policies:
Since (unlike FutureTask) this class has no direct control over the computation that causes it to be completed, cancellation is treated as just another form of exceptional completion. Method cancel has the same effect as completeExceptionally(new CancellationException()). Method isCompletedExceptionally() can be used to determine if a CompletableFuture completed in any exceptional fashion.
In case of exceptional completion with a CompletionException, methods get() and get(long, TimeUnit) throw an ExecutionException with the same cause as held in the corresponding CompletionException. To simplify usage in most contexts, this class also defines methods join() and getNow(T) that instead throw the CompletionException directly in these cases.
A Future that may be explicitly completed (setting its value and status), and may be used as a CompletionStage, supporting dependent functions and actions that trigger upon its completion. When two or more threads attempt to complete, completeExceptionally, or cancel a CompletableFuture, only one of them succeeds. In addition to these and related methods for directly manipulating status and results, CompletableFuture implements interface CompletionStage with the following policies: Actions supplied for dependent completions of non-async methods may be performed by the thread that completes the current CompletableFuture, or by any other caller of a completion method. All async methods without an explicit Executor argument are performed using the ForkJoinPool.commonPool() (unless it does not support a parallelism level of at least two, in which case, a new Thread is created to run each task). To simplify monitoring, debugging, and tracking, all generated asynchronous tasks are instances of the marker interface CompletableFuture.AsynchronousCompletionTask. All CompletionStage methods are implemented independently of other public methods, so the behavior of one method is not impacted by overrides of others in subclasses. CompletableFuture also implements Future with the following policies: Since (unlike FutureTask) this class has no direct control over the computation that causes it to be completed, cancellation is treated as just another form of exceptional completion. Method cancel has the same effect as completeExceptionally(new CancellationException()). Method isCompletedExceptionally() can be used to determine if a CompletableFuture completed in any exceptional fashion. In case of exceptional completion with a CompletionException, methods get() and get(long, TimeUnit) throw an ExecutionException with the same cause as held in the corresponding CompletionException. To simplify usage in most contexts, this class also defines methods join() and getNow(T) that instead throw the CompletionException directly in these cases.
(*all-of cfs)
Returns a new CompletableFuture that is completed when all of the given CompletableFutures complete. If any of the given CompletableFutures complete exceptionally, then the returned CompletableFuture also does so, with a CompletionException holding this exception as its cause. Otherwise, the results, if any, of the given CompletableFutures are not reflected in the returned CompletableFuture, but may be obtained by inspecting them individually. If no CompletableFutures are provided, returns a CompletableFuture completed with the value null.
Among the applications of this method is to await completion of a set of independent CompletableFutures before continuing a program, as in: CompletableFuture.allOf(c1, c2, c3).join();.
cfs - the CompletableFutures - java.util.concurrent.CompletableFuture<?>
returns: a new CompletableFuture that is completed when all of the
given CompletableFutures complete - java.util.concurrent.CompletableFuture<java.lang.Void>
throws: java.lang.NullPointerException - if the array or any of its elements are null
Returns a new CompletableFuture that is completed when all of the given CompletableFutures complete. If any of the given CompletableFutures complete exceptionally, then the returned CompletableFuture also does so, with a CompletionException holding this exception as its cause. Otherwise, the results, if any, of the given CompletableFutures are not reflected in the returned CompletableFuture, but may be obtained by inspecting them individually. If no CompletableFutures are provided, returns a CompletableFuture completed with the value null. Among the applications of this method is to await completion of a set of independent CompletableFutures before continuing a program, as in: CompletableFuture.allOf(c1, c2, c3).join();. cfs - the CompletableFutures - `java.util.concurrent.CompletableFuture<?>` returns: a new CompletableFuture that is completed when all of the given CompletableFutures complete - `java.util.concurrent.CompletableFuture<java.lang.Void>` throws: java.lang.NullPointerException - if the array or any of its elements are null
(*any-of cfs)
Returns a new CompletableFuture that is completed when any of the given CompletableFutures complete, with the same result. Otherwise, if it completed exceptionally, the returned CompletableFuture also does so, with a CompletionException holding this exception as its cause. If no CompletableFutures are provided, returns an incomplete CompletableFuture.
cfs - the CompletableFutures - java.util.concurrent.CompletableFuture<?>
returns: a new CompletableFuture that is completed with the
result or exception of any of the given CompletableFutures when
one completes - java.util.concurrent.CompletableFuture<java.lang.Object>
throws: java.lang.NullPointerException - if the array or any of its elements are null
Returns a new CompletableFuture that is completed when any of the given CompletableFutures complete, with the same result. Otherwise, if it completed exceptionally, the returned CompletableFuture also does so, with a CompletionException holding this exception as its cause. If no CompletableFutures are provided, returns an incomplete CompletableFuture. cfs - the CompletableFutures - `java.util.concurrent.CompletableFuture<?>` returns: a new CompletableFuture that is completed with the result or exception of any of the given CompletableFutures when one completes - `java.util.concurrent.CompletableFuture<java.lang.Object>` throws: java.lang.NullPointerException - if the array or any of its elements are null
(*completed-future value)
Returns a new CompletableFuture that is already completed with the given value.
value - the value - U
returns: the completed CompletableFuture - <U> java.util.concurrent.CompletableFuture<U>
Returns a new CompletableFuture that is already completed with the given value. value - the value - `U` returns: the completed CompletableFuture - `<U> java.util.concurrent.CompletableFuture<U>`
(*run-async runnable)
(*run-async runnable executor)
Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor after it runs the given action.
runnable - the action to run before completing the returned CompletableFuture - java.lang.Runnable
executor - the executor to use for asynchronous execution - java.util.concurrent.Executor
returns: the new CompletableFuture - java.util.concurrent.CompletableFuture<java.lang.Void>
Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor after it runs the given action. runnable - the action to run before completing the returned CompletableFuture - `java.lang.Runnable` executor - the executor to use for asynchronous execution - `java.util.concurrent.Executor` returns: the new CompletableFuture - `java.util.concurrent.CompletableFuture<java.lang.Void>`
(*supply-async supplier)
(*supply-async supplier executor)
Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor with the value obtained by calling the given Supplier.
supplier - a function returning the value to be used to complete the returned CompletableFuture - java.util.function.Supplier<U>
executor - the executor to use for asynchronous execution - java.util.concurrent.Executor
returns: the new CompletableFuture - <U> java.util.concurrent.CompletableFuture<U>
Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor with the value obtained by calling the given Supplier. supplier - a function returning the value to be used to complete the returned CompletableFuture - `java.util.function.Supplier<U>` executor - the executor to use for asynchronous execution - `java.util.concurrent.Executor` returns: the new CompletableFuture - `<U> java.util.concurrent.CompletableFuture<U>`
(->completable-future)
Constructor.
Creates a new incomplete CompletableFuture.
Constructor. Creates a new incomplete CompletableFuture.
(accept-either this other action)
Description copied from interface: CompletionStage
other - the other CompletionStage - CompletableFuture.T>
action - the action to perform before completing the returned CompletionStage - CompletableFuture.T>
returns: the new CompletionStage - java.util.concurrent.CompletableFuture<java.lang.Void>
Description copied from interface: CompletionStage other - the other CompletionStage - `CompletableFuture.T>` action - the action to perform before completing the returned CompletionStage - `CompletableFuture.T>` returns: the new CompletionStage - `java.util.concurrent.CompletableFuture<java.lang.Void>`
(accept-either-async this other action)
(accept-either-async this other action executor)
Description copied from interface: CompletionStage
other - the other CompletionStage - CompletableFuture.T>
action - the action to perform before completing the returned CompletionStage - CompletableFuture.T>
executor - the executor to use for asynchronous execution - java.util.concurrent.Executor
returns: the new CompletionStage - java.util.concurrent.CompletableFuture<java.lang.Void>
Description copied from interface: CompletionStage other - the other CompletionStage - `CompletableFuture.T>` action - the action to perform before completing the returned CompletionStage - `CompletableFuture.T>` executor - the executor to use for asynchronous execution - `java.util.concurrent.Executor` returns: the new CompletionStage - `java.util.concurrent.CompletableFuture<java.lang.Void>`
(apply-to-either this other fn)
Description copied from interface: CompletionStage
other - the other CompletionStage - CompletableFuture.T>
fn - the function to use to compute the value of the returned CompletionStage - CompletableFuture.T,U>
returns: the new CompletionStage - <U> java.util.concurrent.CompletableFuture<U>
Description copied from interface: CompletionStage other - the other CompletionStage - `CompletableFuture.T>` fn - the function to use to compute the value of the returned CompletionStage - `CompletableFuture.T,U>` returns: the new CompletionStage - `<U> java.util.concurrent.CompletableFuture<U>`
(apply-to-either-async this other fn)
(apply-to-either-async this other fn executor)
Description copied from interface: CompletionStage
other - the other CompletionStage - CompletableFuture.T>
fn - the function to use to compute the value of the returned CompletionStage - CompletableFuture.T,U>
executor - the executor to use for asynchronous execution - java.util.concurrent.Executor
returns: the new CompletionStage - <U> java.util.concurrent.CompletableFuture<U>
Description copied from interface: CompletionStage other - the other CompletionStage - `CompletableFuture.T>` fn - the function to use to compute the value of the returned CompletionStage - `CompletableFuture.T,U>` executor - the executor to use for asynchronous execution - `java.util.concurrent.Executor` returns: the new CompletionStage - `<U> java.util.concurrent.CompletableFuture<U>`
(cancel this may-interrupt-if-running)
If not already completed, completes this CompletableFuture with a CancellationException. Dependent CompletableFutures that have not already completed will also complete exceptionally, with a CompletionException caused by this CancellationException.
may-interrupt-if-running - this value has no effect in this implementation because interrupts are not used to control processing. - boolean
returns: true if this task is now cancelled - boolean
If not already completed, completes this CompletableFuture with a CancellationException. Dependent CompletableFutures that have not already completed will also complete exceptionally, with a CompletionException caused by this CancellationException. may-interrupt-if-running - this value has no effect in this implementation because interrupts are not used to control processing. - `boolean` returns: true if this task is now cancelled - `boolean`
(cancelled? this)
Returns true if this CompletableFuture was cancelled before it completed normally.
returns: true if this CompletableFuture was cancelled
before it completed normally - boolean
Returns true if this CompletableFuture was cancelled before it completed normally. returns: true if this CompletableFuture was cancelled before it completed normally - `boolean`
(complete this value)
If not already completed, sets the value returned by get() and related methods to the given value.
value - the result value - CompletableFuture.T
returns: true if this invocation caused this CompletableFuture
to transition to a completed state, else false - boolean
If not already completed, sets the value returned by get() and related methods to the given value. value - the result value - `CompletableFuture.T` returns: true if this invocation caused this CompletableFuture to transition to a completed state, else false - `boolean`
(complete-exceptionally this ex)
If not already completed, causes invocations of get() and related methods to throw the given exception.
ex - the exception - java.lang.Throwable
returns: true if this invocation caused this CompletableFuture
to transition to a completed state, else false - boolean
If not already completed, causes invocations of get() and related methods to throw the given exception. ex - the exception - `java.lang.Throwable` returns: true if this invocation caused this CompletableFuture to transition to a completed state, else false - `boolean`
(completed-exceptionally? this)
Returns true if this CompletableFuture completed exceptionally, in any way. Possible causes include cancellation, explicit invocation of completeExceptionally, and abrupt termination of a CompletionStage action.
returns: true if this CompletableFuture completed
exceptionally - boolean
Returns true if this CompletableFuture completed exceptionally, in any way. Possible causes include cancellation, explicit invocation of completeExceptionally, and abrupt termination of a CompletionStage action. returns: true if this CompletableFuture completed exceptionally - `boolean`
(done? this)
Returns true if completed in any fashion: normally, exceptionally, or via cancellation.
returns: true if completed - boolean
Returns true if completed in any fashion: normally, exceptionally, or via cancellation. returns: true if completed - `boolean`
(exceptionally this fn)
Returns a new CompletableFuture that is completed when this CompletableFuture completes, with the result of the given function of the exception triggering this CompletableFuture's completion when it completes exceptionally; otherwise, if this CompletableFuture completes normally, then the returned CompletableFuture also completes normally with the same value. Note: More flexible versions of this functionality are available using methods whenComplete and handle.
fn - the function to use to compute the value of the returned CompletableFuture if this CompletableFuture completed exceptionally - CompletableFuture.T>
returns: the new CompletableFuture - java.util.concurrent.CompletableFuture<CompletableFuture.T>
Returns a new CompletableFuture that is completed when this CompletableFuture completes, with the result of the given function of the exception triggering this CompletableFuture's completion when it completes exceptionally; otherwise, if this CompletableFuture completes normally, then the returned CompletableFuture also completes normally with the same value. Note: More flexible versions of this functionality are available using methods whenComplete and handle. fn - the function to use to compute the value of the returned CompletableFuture if this CompletableFuture completed exceptionally - `CompletableFuture.T>` returns: the new CompletableFuture - `java.util.concurrent.CompletableFuture<CompletableFuture.T>`
(get this)
(get this timeout unit)
Waits if necessary for at most the given time for this future to complete, and then returns its result, if available.
timeout - the maximum time to wait - long
unit - the time unit of the timeout argument - java.util.concurrent.TimeUnit
returns: the result value - CompletableFuture.T
throws: java.util.concurrent.CancellationException - if this future was cancelled
Waits if necessary for at most the given time for this future to complete, and then returns its result, if available. timeout - the maximum time to wait - `long` unit - the time unit of the timeout argument - `java.util.concurrent.TimeUnit` returns: the result value - `CompletableFuture.T` throws: java.util.concurrent.CancellationException - if this future was cancelled
(get-now this value-if-absent)
Returns the result value (or throws any encountered exception) if completed, else returns the given valueIfAbsent.
value-if-absent - the value to return if not completed - CompletableFuture.T
returns: the result value, if completed, else the given valueIfAbsent - CompletableFuture.T
throws: java.util.concurrent.CancellationException - if the computation was cancelled
Returns the result value (or throws any encountered exception) if completed, else returns the given valueIfAbsent. value-if-absent - the value to return if not completed - `CompletableFuture.T` returns: the result value, if completed, else the given valueIfAbsent - `CompletableFuture.T` throws: java.util.concurrent.CancellationException - if the computation was cancelled
(get-number-of-dependents this)
Returns the estimated number of CompletableFutures whose completions are awaiting completion of this CompletableFuture. This method is designed for use in monitoring system state, not for synchronization control.
returns: the number of dependent CompletableFutures - int
Returns the estimated number of CompletableFutures whose completions are awaiting completion of this CompletableFuture. This method is designed for use in monitoring system state, not for synchronization control. returns: the number of dependent CompletableFutures - `int`
(handle this fn)
Description copied from interface: CompletionStage
fn - the function to use to compute the value of the returned CompletionStage - U>
returns: the new CompletionStage - <U> java.util.concurrent.CompletableFuture<U>
Description copied from interface: CompletionStage fn - the function to use to compute the value of the returned CompletionStage - `U>` returns: the new CompletionStage - `<U> java.util.concurrent.CompletableFuture<U>`
(handle-async this fn)
(handle-async this fn executor)
Description copied from interface: CompletionStage
fn - the function to use to compute the value of the returned CompletionStage - U>
executor - the executor to use for asynchronous execution - java.util.concurrent.Executor
returns: the new CompletionStage - <U> java.util.concurrent.CompletableFuture<U>
Description copied from interface: CompletionStage fn - the function to use to compute the value of the returned CompletionStage - `U>` executor - the executor to use for asynchronous execution - `java.util.concurrent.Executor` returns: the new CompletionStage - `<U> java.util.concurrent.CompletableFuture<U>`
(join this)
Returns the result value when complete, or throws an (unchecked) exception if completed exceptionally. To better conform with the use of common functional forms, if a computation involved in the completion of this CompletableFuture threw an exception, this method throws an (unchecked) CompletionException with the underlying exception as its cause.
returns: the result value - CompletableFuture.T
throws: java.util.concurrent.CancellationException - if the computation was cancelled
Returns the result value when complete, or throws an (unchecked) exception if completed exceptionally. To better conform with the use of common functional forms, if a computation involved in the completion of this CompletableFuture threw an exception, this method throws an (unchecked) CompletionException with the underlying exception as its cause. returns: the result value - `CompletableFuture.T` throws: java.util.concurrent.CancellationException - if the computation was cancelled
(obtrude-exception this ex)
Forcibly causes subsequent invocations of method get() and related methods to throw the given exception, whether or not already completed. This method is designed for use only in error recovery actions, and even in such situations may result in ongoing dependent completions using established versus overwritten outcomes.
ex - the exception - java.lang.Throwable
throws: java.lang.NullPointerException - if the exception is null
Forcibly causes subsequent invocations of method get() and related methods to throw the given exception, whether or not already completed. This method is designed for use only in error recovery actions, and even in such situations may result in ongoing dependent completions using established versus overwritten outcomes. ex - the exception - `java.lang.Throwable` throws: java.lang.NullPointerException - if the exception is null
(obtrude-value this value)
Forcibly sets or resets the value subsequently returned by method get() and related methods, whether or not already completed. This method is designed for use only in error recovery actions, and even in such situations may result in ongoing dependent completions using established versus overwritten outcomes.
value - the completion value - CompletableFuture.T
Forcibly sets or resets the value subsequently returned by method get() and related methods, whether or not already completed. This method is designed for use only in error recovery actions, and even in such situations may result in ongoing dependent completions using established versus overwritten outcomes. value - the completion value - `CompletableFuture.T`
(run-after-both this other action)
Description copied from interface: CompletionStage
other - the other CompletionStage - java.util.concurrent.CompletionStage<?>
action - the action to perform before completing the returned CompletionStage - java.lang.Runnable
returns: the new CompletionStage - java.util.concurrent.CompletableFuture<java.lang.Void>
Description copied from interface: CompletionStage other - the other CompletionStage - `java.util.concurrent.CompletionStage<?>` action - the action to perform before completing the returned CompletionStage - `java.lang.Runnable` returns: the new CompletionStage - `java.util.concurrent.CompletableFuture<java.lang.Void>`
(run-after-both-async this other action)
(run-after-both-async this other action executor)
Description copied from interface: CompletionStage
other - the other CompletionStage - java.util.concurrent.CompletionStage<?>
action - the action to perform before completing the returned CompletionStage - java.lang.Runnable
executor - the executor to use for asynchronous execution - java.util.concurrent.Executor
returns: the new CompletionStage - java.util.concurrent.CompletableFuture<java.lang.Void>
Description copied from interface: CompletionStage other - the other CompletionStage - `java.util.concurrent.CompletionStage<?>` action - the action to perform before completing the returned CompletionStage - `java.lang.Runnable` executor - the executor to use for asynchronous execution - `java.util.concurrent.Executor` returns: the new CompletionStage - `java.util.concurrent.CompletableFuture<java.lang.Void>`
(run-after-either this other action)
Description copied from interface: CompletionStage
other - the other CompletionStage - java.util.concurrent.CompletionStage<?>
action - the action to perform before completing the returned CompletionStage - java.lang.Runnable
returns: the new CompletionStage - java.util.concurrent.CompletableFuture<java.lang.Void>
Description copied from interface: CompletionStage other - the other CompletionStage - `java.util.concurrent.CompletionStage<?>` action - the action to perform before completing the returned CompletionStage - `java.lang.Runnable` returns: the new CompletionStage - `java.util.concurrent.CompletableFuture<java.lang.Void>`
(run-after-either-async this other action)
(run-after-either-async this other action executor)
Description copied from interface: CompletionStage
other - the other CompletionStage - java.util.concurrent.CompletionStage<?>
action - the action to perform before completing the returned CompletionStage - java.lang.Runnable
executor - the executor to use for asynchronous execution - java.util.concurrent.Executor
returns: the new CompletionStage - java.util.concurrent.CompletableFuture<java.lang.Void>
Description copied from interface: CompletionStage other - the other CompletionStage - `java.util.concurrent.CompletionStage<?>` action - the action to perform before completing the returned CompletionStage - `java.lang.Runnable` executor - the executor to use for asynchronous execution - `java.util.concurrent.Executor` returns: the new CompletionStage - `java.util.concurrent.CompletableFuture<java.lang.Void>`
(then-accept this action)
Description copied from interface: CompletionStage
action - the action to perform before completing the returned CompletionStage - CompletableFuture.T>
returns: the new CompletionStage - java.util.concurrent.CompletableFuture<java.lang.Void>
Description copied from interface: CompletionStage action - the action to perform before completing the returned CompletionStage - `CompletableFuture.T>` returns: the new CompletionStage - `java.util.concurrent.CompletableFuture<java.lang.Void>`
(then-accept-async this action)
(then-accept-async this action executor)
Description copied from interface: CompletionStage
action - the action to perform before completing the returned CompletionStage - CompletableFuture.T>
executor - the executor to use for asynchronous execution - java.util.concurrent.Executor
returns: the new CompletionStage - java.util.concurrent.CompletableFuture<java.lang.Void>
Description copied from interface: CompletionStage action - the action to perform before completing the returned CompletionStage - `CompletableFuture.T>` executor - the executor to use for asynchronous execution - `java.util.concurrent.Executor` returns: the new CompletionStage - `java.util.concurrent.CompletableFuture<java.lang.Void>`
(then-accept-both this other action)
Description copied from interface: CompletionStage
other - the other CompletionStage - U>
action - the action to perform before completing the returned CompletionStage - U>
returns: the new CompletionStage - <U> java.util.concurrent.CompletableFuture<java.lang.Void>
Description copied from interface: CompletionStage other - the other CompletionStage - `U>` action - the action to perform before completing the returned CompletionStage - `U>` returns: the new CompletionStage - `<U> java.util.concurrent.CompletableFuture<java.lang.Void>`
(then-accept-both-async this other action)
(then-accept-both-async this other action executor)
Description copied from interface: CompletionStage
other - the other CompletionStage - U>
action - the action to perform before completing the returned CompletionStage - U>
executor - the executor to use for asynchronous execution - java.util.concurrent.Executor
returns: the new CompletionStage - <U> java.util.concurrent.CompletableFuture<java.lang.Void>
Description copied from interface: CompletionStage other - the other CompletionStage - `U>` action - the action to perform before completing the returned CompletionStage - `U>` executor - the executor to use for asynchronous execution - `java.util.concurrent.Executor` returns: the new CompletionStage - `<U> java.util.concurrent.CompletableFuture<java.lang.Void>`
(then-apply this fn)
Description copied from interface: CompletionStage
fn - the function to use to compute the value of the returned CompletionStage - U>
returns: the new CompletionStage - <U> java.util.concurrent.CompletableFuture<U>
Description copied from interface: CompletionStage fn - the function to use to compute the value of the returned CompletionStage - `U>` returns: the new CompletionStage - `<U> java.util.concurrent.CompletableFuture<U>`
(then-apply-async this fn)
(then-apply-async this fn executor)
Description copied from interface: CompletionStage
fn - the function to use to compute the value of the returned CompletionStage - U>
executor - the executor to use for asynchronous execution - java.util.concurrent.Executor
returns: the new CompletionStage - <U> java.util.concurrent.CompletableFuture<U>
Description copied from interface: CompletionStage fn - the function to use to compute the value of the returned CompletionStage - `U>` executor - the executor to use for asynchronous execution - `java.util.concurrent.Executor` returns: the new CompletionStage - `<U> java.util.concurrent.CompletableFuture<U>`
(then-combine this other fn)
Description copied from interface: CompletionStage
other - the other CompletionStage - U>
fn - the function to use to compute the value of the returned CompletionStage - V>
returns: the new CompletionStage - <U,V> java.util.concurrent.CompletableFuture<V>
Description copied from interface: CompletionStage other - the other CompletionStage - `U>` fn - the function to use to compute the value of the returned CompletionStage - `V>` returns: the new CompletionStage - `<U,V> java.util.concurrent.CompletableFuture<V>`
(then-combine-async this other fn)
(then-combine-async this other fn executor)
Description copied from interface: CompletionStage
other - the other CompletionStage - U>
fn - the function to use to compute the value of the returned CompletionStage - V>
executor - the executor to use for asynchronous execution - java.util.concurrent.Executor
returns: the new CompletionStage - <U,V> java.util.concurrent.CompletableFuture<V>
Description copied from interface: CompletionStage other - the other CompletionStage - `U>` fn - the function to use to compute the value of the returned CompletionStage - `V>` executor - the executor to use for asynchronous execution - `java.util.concurrent.Executor` returns: the new CompletionStage - `<U,V> java.util.concurrent.CompletableFuture<V>`
(then-compose this fn)
Description copied from interface: CompletionStage
fn - the function returning a new CompletionStage - java.util.concurrent.CompletionStage<U>>
returns: the CompletionStage - <U> java.util.concurrent.CompletableFuture<U>
Description copied from interface: CompletionStage fn - the function returning a new CompletionStage - `java.util.concurrent.CompletionStage<U>>` returns: the CompletionStage - `<U> java.util.concurrent.CompletableFuture<U>`
(then-compose-async this fn)
(then-compose-async this fn executor)
Description copied from interface: CompletionStage
fn - the function returning a new CompletionStage - java.util.concurrent.CompletionStage<U>>
executor - the executor to use for asynchronous execution - java.util.concurrent.Executor
returns: the CompletionStage - <U> java.util.concurrent.CompletableFuture<U>
Description copied from interface: CompletionStage fn - the function returning a new CompletionStage - `java.util.concurrent.CompletionStage<U>>` executor - the executor to use for asynchronous execution - `java.util.concurrent.Executor` returns: the CompletionStage - `<U> java.util.concurrent.CompletableFuture<U>`
(then-run this action)
Description copied from interface: CompletionStage
action - the action to perform before completing the returned CompletionStage - java.lang.Runnable
returns: the new CompletionStage - java.util.concurrent.CompletableFuture<java.lang.Void>
Description copied from interface: CompletionStage action - the action to perform before completing the returned CompletionStage - `java.lang.Runnable` returns: the new CompletionStage - `java.util.concurrent.CompletableFuture<java.lang.Void>`
(then-run-async this action)
(then-run-async this action executor)
Description copied from interface: CompletionStage
action - the action to perform before completing the returned CompletionStage - java.lang.Runnable
executor - the executor to use for asynchronous execution - java.util.concurrent.Executor
returns: the new CompletionStage - java.util.concurrent.CompletableFuture<java.lang.Void>
Description copied from interface: CompletionStage action - the action to perform before completing the returned CompletionStage - `java.lang.Runnable` executor - the executor to use for asynchronous execution - `java.util.concurrent.Executor` returns: the new CompletionStage - `java.util.concurrent.CompletableFuture<java.lang.Void>`
(to-completable-future this)
Returns this CompletableFuture.
returns: this CompletableFuture - java.util.concurrent.CompletableFuture<CompletableFuture.T>
Returns this CompletableFuture. returns: this CompletableFuture - `java.util.concurrent.CompletableFuture<CompletableFuture.T>`
(to-string this)
Returns a string identifying this CompletableFuture, as well as
its completion state. The state, in brackets, contains the
String Completed Normally
or the String Completed Exceptionally
, or the String Not completed
followed by the number of CompletableFutures
dependent upon its completion, if any.
returns: a string identifying this CompletableFuture, as well as its state - java.lang.String
Returns a string identifying this CompletableFuture, as well as its completion state. The state, in brackets, contains the String `Completed Normally` or the String `Completed Exceptionally`, or the String `Not completed` followed by the number of CompletableFutures dependent upon its completion, if any. returns: a string identifying this CompletableFuture, as well as its state - `java.lang.String`
(when-complete this action)
Description copied from interface: CompletionStage
action - the action to perform - java.lang.Throwable>
returns: the new CompletionStage - java.util.concurrent.CompletableFuture<CompletableFuture.T>
Description copied from interface: CompletionStage action - the action to perform - `java.lang.Throwable>` returns: the new CompletionStage - `java.util.concurrent.CompletableFuture<CompletableFuture.T>`
(when-complete-async this action)
(when-complete-async this action executor)
Description copied from interface: CompletionStage
action - the action to perform - java.lang.Throwable>
executor - the executor to use for asynchronous execution - java.util.concurrent.Executor
returns: the new CompletionStage - java.util.concurrent.CompletableFuture<CompletableFuture.T>
Description copied from interface: CompletionStage action - the action to perform - `java.lang.Throwable>` executor - the executor to use for asynchronous execution - `java.util.concurrent.Executor` returns: the new CompletionStage - `java.util.concurrent.CompletableFuture<CompletableFuture.T>`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close