Interface ReactionStage<T>

Type Parameters:
T - the result of the completion stage
All Superinterfaces:
CompletionStage<T>
All Known Implementing Classes:
BaseCentralisedFuture, CentralisedFuture, IndifferentCentralisedFuture

public interface ReactionStage<T> extends CompletionStage<T>
An extended interface to CompletionStage providing a fourth variant of methods in the form do, doAsync, doAsync; doSync, where do is the general stage consuming operation.

The contract of the Sync methods is that they run according to the specifications of SynchronousExecutor, that is, identically as if ran with the corresponding Async method variant using SynchronousExecutor.executeSync(Runnable) as the functional Executor argument. For example, the following should be equivalent:


stage.thenRunSync(() -> doSomething());
stage.thenRunAsync(() -> doSomething(), syncExecutor::executeSync);

where stage is an instance of this interface and syncExecutor is the implementation of SynchronousExecutor for the application.
Author:
A248