REQUEST
- The request type.RESPONSE
- The response type.public interface Waiter<REQUEST,RESPONSE>
Waiter provides a standard interface for waiting on some condition in either a blocking or asynchronous manner.
Modifier and Type | Method and Description |
---|---|
RESPONSE |
execute()
Executes the waiter callback and blocks until it either returns or throws an exception.
|
Future<Void> |
execute(AsyncHandler<REQUEST,RESPONSE> asyncHandler)
Executes the waiter callback and returns a Future.
|
RESPONSE execute() throws Exception
Executes the waiter callback and blocks until it either returns or throws an exception.
Exception
- If the waiter timed out.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.
asyncHandler
- The async handler to call, must not be null.Copyright © 2016–2024. All rights reserved.