Req - the request typeResp - the response typepublic interface ReqRespChannel<Req,Resp> extends Terminable
This is a high-level interface, implemented in SimpleReqRespChannel
using lower-level ConversationChannels and Channels.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ReqRespChannel.AsyncResponseHandler<Req,Resp> |
static interface |
ReqRespChannel.ResponseHandler<Req,Resp> |
EMPTY| Modifier and Type | Method and Description |
|---|---|
void |
asyncResponseHandler(ReqRespChannel.AsyncResponseHandler<Req,Resp> handler)
Registers a response handler that returns a Promise.
|
Promise<Resp> |
request(Req req)
Sends a request and returns a promise encapsulating the response.
|
void |
responseHandler(ReqRespChannel.ResponseHandler<Req,Resp> handler)
Registers a response handler.
|
bindWith, close, closeAndReportException, closeSilently, isClosedPromise<Resp> request(Req req)
The promise will complete exceptionally if a response is not received before the timeout expires, by default after 5 seconds.
req - the request objectvoid responseHandler(ReqRespChannel.ResponseHandler<Req,Resp> handler)
handler - the response handlervoid asyncResponseHandler(ReqRespChannel.AsyncResponseHandler<Req,Resp> handler)
handler - the response handlerCopyright © 2022. All rights reserved.