Module xaos.core

Class DefaultExecutorCompletionStage<T>

  • Type Parameters:
    T - The type passed to the consumers of this CompletionStage methods.
    All Implemented Interfaces:
    CompletionStage<T>

    public class DefaultExecutorCompletionStage<T>
    extends Object
    implements CompletionStage<T>
    Completion stage wrapper that uses the provided executor as both the default execution facility and the default asynchronous execution facility. A CompletionStage returned from any of this completion stage's methods inherits this stage's execution facilities. This means, for example, that
     this.thenApply(f).thenAcceptAsync(g).thenRun(h)
    is equivalent to
     this.thenApplyAsync(f, executor).thenAcceptAsync(g, executor).thenRunAsync(h, executor)
    where executor is the executor this stage was created with.
    Author:
    claudio.rosati@esss.se
    See Also:
    LiveDirsFX:org.fxmisc.livedirs.CompletionStageWithDefaultExecutor