Package io.grpc.servlet.jakarta
Class ServletServerStream.Sink
- java.lang.Object
-
- io.grpc.servlet.jakarta.ServletServerStream.Sink
-
- All Implemented Interfaces:
AbstractServerStream.Sink
- Enclosing class:
- ServletServerStream
private final class ServletServerStream.Sink extends java.lang.Object implements AbstractServerStream.Sink
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ServletServerStream.TrailerSupplier
trailerSupplier
-
Constructor Summary
Constructors Modifier Constructor Description private
Sink()
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Field Detail
-
trailerSupplier
final ServletServerStream.TrailerSupplier trailerSupplier
-
-
Method Detail
-
writeHeaders
public void writeHeaders(Metadata headers, boolean flush)
Description copied from interface:AbstractServerStream.Sink
Sends response headers to the remote end point.- Specified by:
writeHeaders
in interfaceAbstractServerStream.Sink
- Parameters:
headers
- the headers to be sent to client.
-
writeFrame
public void writeFrame(@Nullable WritableBuffer frame, boolean flush, int numMessages)
Description copied from interface:AbstractServerStream.Sink
Sends an outbound frame to the remote end point.- Specified by:
writeFrame
in interfaceAbstractServerStream.Sink
- 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
public void writeTrailers(Metadata trailers, boolean headersSent, Status status)
Description copied from interface:AbstractServerStream.Sink
Sends trailers to the remote end point. This call implies end of stream.- Specified by:
writeTrailers
in interfaceAbstractServerStream.Sink
- 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
public void cancel(Status status)
Description copied from interface:AbstractServerStream.Sink
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)
.- Specified by:
cancel
in interfaceAbstractServerStream.Sink
-
-