ReqT
- request object typeResT
- response object typepublic abstract class RequestStreamObserver<ReqT,ResT> extends Object implements io.grpc.stub.StreamObserver<ReqT>
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
RequestStreamObserver() |
Modifier and Type | Method and Description |
---|---|
abstract ResT |
exec(ReqT req)
Executes on a request to return a response.
|
abstract void |
handleError(String message,
Throwable t)
Handles errors depending on the type.
|
void |
onCompleted()
Properly shutdown the stream observer.
|
void |
onError(Throwable t)
Handles errors that occur and attempts to restart the stream observer if possible.
|
void |
onNext(ReqT request)
Generates a response and sends it through the response stream observer.
|
abstract void |
restart()
Handles restarting the request stream observer.
|
void |
start(io.grpc.stub.StreamObserver<ResT> responseStreamObserver,
ResT resp)
Initialize the response stream observer.
|
public void onNext(ReqT request)
onNext
in interface io.grpc.stub.StreamObserver<ReqT>
request
- request object to execute onpublic void onError(Throwable t)
onError
in interface io.grpc.stub.StreamObserver<ReqT>
t
- Throwablepublic void onCompleted()
onCompleted
in interface io.grpc.stub.StreamObserver<ReqT>
public void start(io.grpc.stub.StreamObserver<ResT> responseStreamObserver, ResT resp)
responseStreamObserver
- response stream observerresp
- response objectpublic abstract ResT exec(ReqT req)
req
- request object to execute onpublic abstract void restart()
Copyright © 2023. All Rights Reserved.