java.lang.Object
org.eclipse.microprofile.fault.tolerance.tck.asynchronous.AsyncClient

@RequestScoped public class AsyncClient extends Object
A client to demonstrate Asynchronous behaviour
Author:
Antoine Sabot-Durand
  • Constructor Details

    • AsyncClient

      public AsyncClient()
  • Method Details

    • service

      @Asynchronous public Future<Connection> service(Future<?> waitCondition)
      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 finished
      throwException - 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

      @Asynchronous public CompletionStage<Connection> serviceCS(Future<?> waitCondition)
    • serviceCS

      @Asynchronous public CompletionStage<Connection> serviceCS(Future<?> waitCondition, CompletionStage<Connection> stageToReturn)