Interface AbstractClientStream.Sink

  • All Known Implementing Classes:
    NettyClientStream.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

      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 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 Detail

      • 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.