Package io.grpc.internal
Interface AbstractClientStream.Sink
- Enclosing class:
AbstractClientStream
protected static interface AbstractClientStream.Sink
A sink for outbound operations, separated from the stream simply to avoid name
collisions/confusion. Only called from application thread.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Tears down the stream, typically in the event of a timeout.void
writeFrame
(WritableBuffer frame, boolean endOfStream, boolean flush, int numMessages) Sends an outbound frame to the remote end point.void
writeHeaders
(Metadata metadata, byte[] payload) Sends the request headers to the remote end point.
-
Method Details
-
writeHeaders
Sends the request headers to the remote end point.- Parameters:
metadata
- the metadata to be sentpayload
- the payload needs to be sent in the headers if not null. Should only be used when sending an unary GET request
-
writeFrame
void writeFrame(@Nullable WritableBuffer frame, boolean endOfStream, boolean flush, int numMessages) Sends an outbound frame to the remote end point.- Parameters:
frame
- a buffer containing the chunk of data to be sent, ornull
ifendOfStream
with no data to sendendOfStream
-true
if this is the last frame;flush
is guaranteed to betrue
if this istrue
flush
-true
if more data may not be arriving soonnumMessages
- the number of messages this series of frames represents, must be >= 0.
-
cancel
Tears down the stream, typically in the event of a timeout. This method may be called multiple times and from any thread.This is a clone of
ClientStream.cancel(Status)
;AbstractClientStream.cancel(io.grpc.Status)
delegates to this method.
-