hunt.concurrency.CompletableFuture

Undocumented in source.

Members

Classes

AbstractCompletableFuture
class AbstractCompletableFuture
AnyOf
class AnyOf(T)

Completion for an anyOf input future.

AsyncRun
class AsyncRun
Undocumented in source.
AsyncSupply
class AsyncSupply(T)
Undocumented in source.
BiAccept
class BiAccept(T, U)
Undocumented in source.
BiApply
class BiApply(T, U, V)
Undocumented in source.
BiCompletion
class BiCompletion

A Completion for an action with two sources

BiRelay
class BiRelay
Undocumented in source.
BiRun
class BiRun(T, U)
Undocumented in source.
CoCompletion
class CoCompletion

A Completion delegating to a BiCompletion

CompletableFuture
class CompletableFuture(T)

A {@link Future} that may be explicitly completed (setting its value and status), and may be used as a {@link CompletionStage}, supporting dependent functions and actions that trigger upon its completion.

Completion
class Completion
Undocumented in source.
DaemonThreadFactory
class DaemonThreadFactory
Undocumented in source.
DelayedCompleter
class DelayedCompleter(U)

Action to complete on timeout

DelayedCompleter
class DelayedCompleter(U)
Undocumented in source.
DelayedExecutor
class DelayedExecutor
Undocumented in source.
Delayer
class Delayer

Singleton delay scheduler, used only for starting and cancelling tasks.

MinimalStage
class MinimalStage(T)

A subclass that just throws UOE for most non-CompletionStage methods.

OrAccept
class OrAccept(T, U : T)
Undocumented in source.
OrApply
class OrApply(T, U : T, V)
Undocumented in source.
OrRun
class OrRun
Undocumented in source.
Signaller
class Signaller

Completion for recording and releasing a waiting thread. This class implements ManagedBlocker to avoid starvation when blocking actions pile up in ForkJoinPools.

TaskSubmitter
class TaskSubmitter

Action to submit user task

Timeout
class Timeout

Action to completeExceptionally on timeout

UniAccept
class UniAccept(T)
Undocumented in source.
UniApply
class UniApply(T, V)
Undocumented in source.
UniCompletion
class UniCompletion
Undocumented in source.
UniCompose
class UniCompose(T, V)
Undocumented in source.
UniExceptionally
class UniExceptionally(T)
Undocumented in source.
UniHandle
class UniHandle(T, V)
Undocumented in source.
UniRelay
class UniRelay(U, T : U)
Undocumented in source.
UniRun
class UniRun(T)
Undocumented in source.
UniWhenComplete
class UniWhenComplete(T)
Undocumented in source.

Functions

allOf
CompletableFuture!(void) allOf(CompletableFuture!T[] 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 {@code null}.

asyncRunStage
CompletableFuture!(void) asyncRunStage(Executor e, Action f)
Undocumented in source. Be warned that the author may not have intended to support it.
asyncSupplyStage
CompletableFuture!(U) asyncSupplyStage(Executor e, Supplier!(U) f)
Undocumented in source. Be warned that the author may not have intended to support it.
completedFuture
CompletableFuture!(U) completedFuture(U value)

Returns a new CompletableFuture that is already completed with the given value.

completedStage
CompletionStage!(U) completedStage(U value)

Returns a new CompletionStage that is already completed with the given value and supports only those methods in interface {@link CompletionStage}.

delayedExecutor
Executor delayedExecutor(Duration delay, Executor executor)

Returns a new Executor that submits a task to the given base executor after the given delay (or no delay if non-positive). Each delay commences upon invocation of the returned executor's {@code execute} method.

delayedExecutor
Executor delayedExecutor(Duration delay)

Returns a new Executor that submits a task to the default executor after the given delay (or no delay if non-positive). Each delay commences upon invocation of the returned executor's {@code execute} method.

failedFuture
CompletableFuture!(U) failedFuture(Throwable ex)

Returns a new CompletableFuture that is already completed exceptionally with the given exception.

failedStage
CompletionStage!(U) failedStage(Throwable ex)

Returns a new CompletionStage that is already completed exceptionally with the given exception and supports only those methods in interface {@link CompletionStage}.

runAsync
CompletableFuture!(void) runAsync(Runnable runnable)

Returns a new CompletableFuture that is asynchronously completed by a task running in the {@link ForkJoinPool#commonPool()} after it runs the given action.

runAsync
CompletableFuture!(void) runAsync(Action act)
Undocumented in source. Be warned that the author may not have intended to support it.
runAsync
CompletableFuture!(void) runAsync(Runnable runnable, Executor executor)

Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor after it runs the given action.

screenExecutor
Executor screenExecutor(Executor e)

Null-checks user executor argument, and translates uses of commonPool to ASYNC_POOL in case parallelism disabled.

supplyAsync
CompletableFuture!(U) supplyAsync(Supplier!(U) supplier)

Returns a new CompletableFuture that is asynchronously completed by a task running in the {@link ForkJoinPool#commonPool()} with the value obtained by calling the given Supplier.

supplyAsync
CompletableFuture!(U) supplyAsync(Supplier!(U) supplier, Executor 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.

Interfaces

IUniCompletion
interface IUniCompletion

A Completion with a source, dependent, and executor.

Static functions

anyOf
CompletableFuture!(U) anyOf(CompletableFuture!(U)[] 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.

newIncompleteFuture
CompletableFuture!(U) newIncompleteFuture()

Returns a new incomplete CompletableFuture of the type to be returned by a CompletionStage method. Subclasses should normally override this method to return an instance of the same class as this CompletableFuture. The default implementation returns an instance of class CompletableFuture.

Static variables

NIL
AltResult NIL;

The encoding of the null value.

Variables

ASYNC
enum int ASYNC;
Undocumented in source.
NESTED
enum int NESTED;
Undocumented in source.
SYNC
enum int SYNC;
Undocumented in source.

Meta