Class AsyncClient
java.lang.Object
org.eclipse.microprofile.fault.tolerance.tck.asynchronous.AsyncClient
A client to demonstrate Asynchronous behaviour
- Author:
- Antoine Sabot-Durand
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionService an operation until waitCondition is completed or 1000 second timeout.Service an operation until waitCondition is completed or 1000 second timeout.serviceCS
(Future<?> waitCondition, CompletionStage<Connection> stageToReturn)
-
Constructor Details
-
AsyncClient
public AsyncClient()
-
-
Method Details
-
service
Service an operation until waitCondition is completed or 1000 second timeout.- Parameters:
waitCondition
- Execution of this method will delay until the condition is finished- Returns:
- the result as a Future.
-
serviceCS
@Asynchronous public CompletionStage<Connection> serviceCS(Future<?> waitCondition, boolean throwException) Service an operation until waitCondition is completed or 1000 second timeout.- Parameters:
waitCondition
- Execution of this method will delay until the condition is finishedthrowException
- Whether the method should throw an exception (true) or return a stage completed with exception (false)- Returns:
- the result as a CompletionStage. It may be completed with InterruptedException if the thread is interrupted
-
serviceCS
-
serviceCS
@Asynchronous public CompletionStage<Connection> serviceCS(Future<?> waitCondition, CompletionStage<Connection> stageToReturn)
-