Package io.grpc.internal
Interface AbstractClientStream.Sink
-
- All Known Implementing Classes:
NettyClientStream.Sink
- Enclosing class:
- AbstractClientStream
protected static interface AbstractClientStream.SinkA sink for outbound operations, separated from the stream simply to avoid name collisions/confusion. Only called from application thread.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancel(Status status)Tears down the stream, typically in the event of a timeout.voidwriteFrame(WritableBuffer frame, boolean endOfStream, boolean flush, int numMessages)Sends an outbound frame to the remote end point.voidwriteHeaders(Metadata metadata, byte[] payload)Sends the request headers to the remote end point.
-
-
-
Method Detail
-
writeHeaders
void writeHeaders(Metadata metadata, @Nullable byte[] payload)
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, ornullifendOfStreamwith no data to sendendOfStream-trueif this is the last frame;flushis guaranteed to betrueif this istrueflush-trueif more data may not be arriving soonnumMessages- the number of messages this series of frames represents, must be >= 0.
-
cancel
void cancel(Status status)
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.
-
-