Interface StreamObserver<T>
- Type Parameters:
T- the message type
public interface StreamObserver<T>
Receives the messages of a stream: the responses a streaming handler sends, or the responses a client reads from a streaming call.
A handler calls onNext(T) once per message and ends the call with exactly one
of onCompleted() or onError(Throwable). Returning from a server streaming handler
without either completes the call with OK.
-
Method Summary
Modifier and TypeMethodDescriptionvoidEnds the stream withOK.voidEnds the stream with an error.voidSends (or receives) one message.
-
Method Details
-
onNext
-
onError
Ends the stream with an error. AGrpcExceptioncarries its status; anything else ends the call withUNKNOWN.- Parameters:
error- the failure
-
onCompleted
void onCompleted()Ends the stream withOK.
-