Interface StreamListener

All Known Subinterfaces:
ClientStreamListener, ServerStreamListener

public interface StreamListener
An observer of Stream events. It is guaranteed to only have one concurrent callback at a time.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A producer for deframed gRPC messages.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called upon receiving a message from the remote end-point.
    void
    This indicates that the transport is now capable of sending additional messages without requiring excessive buffering internally.
  • Method Details

    • messagesAvailable

      void messagesAvailable(StreamListener.MessageProducer producer)
      Called upon receiving a message from the remote end-point.

      Implementations must eventually drain the provided producer StreamListener.MessageProducer completely by invoking StreamListener.MessageProducer.next() to obtain deframed messages until the producer returns null.

      This method should return quickly, as the same thread may be used to process other streams.

      Parameters:
      producer - supplier of deframed messages.
    • onReady

      void onReady()
      This indicates that the transport is now capable of sending additional messages without requiring excessive buffering internally. This event is just a suggestion and the application is free to ignore it, however doing so may result in excessive buffering within the transport.