Package io.grpc.netty
Class NettyServerStream.Sink
- java.lang.Object
-
- io.grpc.netty.NettyServerStream.Sink
-
- All Implemented Interfaces:
AbstractServerStream.Sink
- Enclosing class:
- NettyServerStream
private class NettyServerStream.Sink extends java.lang.Object implements AbstractServerStream.Sink
-
-
Constructor Summary
Constructors Modifier Constructor Description privateSink()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel(Status status)Tears down the stream, typically in the event of a timeout.voidwriteFrame(WritableBuffer frame, boolean flush, int numMessages)Sends an outbound frame to the remote end point.voidwriteHeaders(Metadata headers, boolean flush)Sends response headers to the remote end point.voidwriteTrailers(Metadata trailers, boolean headersSent, Status status)Sends trailers to the remote end point.
-
-
-
Method Detail
-
writeHeaders
public void writeHeaders(Metadata headers, boolean flush)
Description copied from interface:AbstractServerStream.SinkSends response headers to the remote end point.- Specified by:
writeHeadersin interfaceAbstractServerStream.Sink- Parameters:
headers- the headers to be sent to client.
-
writeFrame
public void writeFrame(WritableBuffer frame, boolean flush, int numMessages)
Description copied from interface:AbstractServerStream.SinkSends an outbound frame to the remote end point.- Specified by:
writeFramein interfaceAbstractServerStream.Sink- Parameters:
frame- a buffer containing the chunk of data to be sent.flush-trueif more data may not be arriving soonnumMessages- the number of messages this frame represents
-
writeTrailers
public void writeTrailers(Metadata trailers, boolean headersSent, Status status)
Description copied from interface:AbstractServerStream.SinkSends trailers to the remote end point. This call implies end of stream.- Specified by:
writeTrailersin interfaceAbstractServerStream.Sink- Parameters:
trailers- metadata to be sent to the end pointheadersSent-trueif response headers have already been sent.status- the status that the call ended with
-
cancel
public void cancel(Status status)
Description copied from interface:AbstractServerStream.SinkTears 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
ServerStream.cancel(Status).- Specified by:
cancelin interfaceAbstractServerStream.Sink
-
-