Interface DcpRequestDispatcher
- All Known Implementing Classes:
DcpMessageHandler
-
Method Summary
Modifier and TypeMethodDescriptioncom.couchbase.client.core.deps.io.netty.util.concurrent.Future
<DcpResponse> sendRequest
(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf message) Assigns a value to the request'sopaque
field and writes the message to the channel.
-
Method Details
-
sendRequest
com.couchbase.client.core.deps.io.netty.util.concurrent.Future<DcpResponse> sendRequest(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf message) Assigns a value to the request'sopaque
field and writes the message to the channel. Returns a Future that is completed when the response is received or the channel is closed.If the response is received, the Future is always considered successful regardless of the status code returned by the server; the caller is responsible for inspecting the status code.
If the channel is not currently active, or if the channel is closed before the response is received, the Future fails with
NotConnectedException
as the cause.Callers are responsible for releasing the ByteBuf from successful Futures. This is true even if a call to
Future.get
orFuture.await
times out, in which case the caller should add a listener to release the buffer when the Future eventually completes.Listeners are invoked by the channel's event loop thread, so they should return quickly.
Callers may wish to use the type alias
DcpResponseListener
when adding listeners.
-