Interface Waiter<REQUEST,​RESPONSE>

  • Type Parameters:
    REQUEST - The request type.
    RESPONSE - The response type.
    All Known Implementing Classes:
    SimpleWaiterImpl

    public interface Waiter<REQUEST,​RESPONSE>
    Waiter provides a standard interface for waiting on some condition in either a blocking or asynchronous manner.
    • Method Detail

      • execute

        RESPONSE execute()
                  throws Exception
        Executes the waiter callback and blocks until it either returns or throws an exception.
        Returns:
        The response.
        Throws:
        Exception - If the waiter timed out.
      • execute

        Future<Void> execute​(AsyncHandler<REQUEST,​RESPONSE> asyncHandler)
        Executes the waiter callback and returns a Future.

        The Future will not contain an information. The provided handler will be invoked with either the successful response instance, or the exception thrown in case of failure.

        Parameters:
        asyncHandler - The async handler to call, must not be null.
        Returns:
        A Future for the submitted request.