protected abstract static class AbstractClientStream.TransportState extends AbstractStream.TransportState
DEFAULT_ONREADY_THRESHOLD
Modifier | Constructor and Description |
---|---|
protected |
TransportState(int maxMessageSize,
StatsTraceContext statsTraceCtx,
TransportTracer transportTracer) |
Modifier and Type | Method and Description |
---|---|
void |
deframerClosed(boolean hasPartialMessage)
Called when the deframer closes.
|
protected void |
inboundDataReceived(ReadableBuffer frame)
Processes the contents of a received data frame from the server.
|
protected void |
inboundHeadersReceived(Metadata headers)
Called by transport implementations when they receive headers.
|
protected void |
inboundTrailersReceived(Metadata trailers,
Status status)
Processes the trailers and status from the server.
|
protected boolean |
isOutboundClosed() |
protected ClientStreamListener |
listener()
Override this method to provide a stream listener.
|
void |
runOnTransportThread(Runnable r) |
void |
setListener(ClientStreamListener listener) |
void |
transportReportStatus(Status status,
boolean stopDelivery,
Metadata trailers)
Report stream closure with status to the application layer if not already reported.
|
void |
transportReportStatus(Status status,
ClientStreamListener.RpcProgress rpcProgress,
boolean stopDelivery,
Metadata trailers)
Report stream closure with status to the application layer if not already reported.
|
closeDeframer, deframe, getStatsTraceContext, getTransportTracer, messagesAvailable, onSentBytes, onStreamAllocated, onStreamDeallocated, requestMessagesFromDeframer, setDecompressor, setFullStreamDecompressor
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bytesRead, deframeFailed
protected TransportState(int maxMessageSize, StatsTraceContext statsTraceCtx, TransportTracer transportTracer)
public final void setListener(ClientStreamListener listener)
public void deframerClosed(boolean hasPartialMessage)
MessageDeframer.Listener
hasPartialMessage
- whether the deframer contained an incomplete message at closing.protected final ClientStreamListener listener()
AbstractStream.TransportState
listener
in class AbstractStream.TransportState
protected final boolean isOutboundClosed()
protected void inboundHeadersReceived(Metadata headers)
headers
- the parsed headersprotected void inboundDataReceived(ReadableBuffer frame)
frame
- the received data frame. Its ownership is transferred to this method.protected void inboundTrailersReceived(Metadata trailers, Status status)
trailers
- the received trailersstatus
- the status extracted from the trailerspublic final void transportReportStatus(Status status, boolean stopDelivery, Metadata trailers)
status
- the new status to setstopDelivery
- if true
, interrupts any further delivery of inbound messages that
may already be queued up in the deframer. If false
, the listener will be
notified immediately after all currently completed messages in the deframer have been
delivered to the application.trailers
- new instance of Trailers
, either empty or those returned by the
serverpublic final void transportReportStatus(Status status, ClientStreamListener.RpcProgress rpcProgress, boolean stopDelivery, Metadata trailers)
status
- the new status to setrpcProgress
- RPC progress that the
ClientStreamListener.closed(Status, RpcProgress, Metadata)
will receivestopDelivery
- if true
, interrupts any further delivery of inbound messages that
may already be queued up in the deframer and overrides any previously queued status.
If false
, the listener will be notified immediately after all currently
completed messages in the deframer have been delivered to the application.trailers
- new instance of Trailers
, either empty or those returned by the
serverpublic void runOnTransportThread(Runnable r)