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 Type
    Method
    Description
    void
    cancel(Status status)
    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

      void writeHeaders(Metadata metadata, @Nullable byte[] payload)
      Sends the request headers to the remote end point.
      Parameters:
      metadata - the metadata to be sent
      payload - 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, or null if endOfStream with no data to send
      endOfStream - true if this is the last frame; flush is guaranteed to be true if this is true
      flush - true if more data may not be arriving soon
      numMessages - 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.