Package io.grpc.internal
Interface AbstractServerStream.Sink
-
- All Known Implementing Classes:
NettyServerStream.Sink
,ServletServerStream.Sink
,ServletServerStream.Sink
- Enclosing class:
- AbstractServerStream
protected static interface AbstractServerStream.Sink
A 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 void
cancel(Status status)
Tears down the stream, typically in the event of a timeout.void
writeFrame(WritableBuffer frame, boolean flush, int numMessages)
Sends an outbound frame to the remote end point.void
writeHeaders(Metadata headers, boolean flush)
Sends response headers to the remote end point.void
writeTrailers(Metadata trailers, boolean headersSent, Status status)
Sends trailers to the remote end point.
-
-
-
Method Detail
-
writeHeaders
void writeHeaders(Metadata headers, boolean flush)
Sends response headers to the remote end point.- Parameters:
headers
- the headers to be sent to client.
-
writeFrame
void writeFrame(WritableBuffer frame, 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.flush
-true
if more data may not be arriving soonnumMessages
- the number of messages this frame represents
-
writeTrailers
void writeTrailers(Metadata trailers, boolean headersSent, Status status)
Sends trailers to the remote end point. This call implies end of stream.- Parameters:
trailers
- metadata to be sent to the end pointheadersSent
-true
if response headers have already been sent.status
- the status that the call ended with
-
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
ServerStream.cancel(Status)
.
-
-