Package io.grpc.internal
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 ClassesModifier and TypeInterfaceDescriptionstatic interface
A producer for deframed gRPC messages. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called upon receiving a message from the remote end-point.void
onReady()
This indicates that the transport is now capable of sending additional messages without requiring excessive buffering internally.
-
Method Details
-
messagesAvailable
Called upon receiving a message from the remote end-point.Implementations must eventually drain the provided
producer
StreamListener.MessageProducer
completely by invokingStreamListener.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.
-