java.lang.Object
io.helidon.grpc.core.SafeStreamObserver<T>
- Type Parameters:
T- the type of response expected
- All Implemented Interfaces:
io.grpc.stub.StreamObserver<T>
A
StreamObserver that handles exceptions correctly.-
Method Summary
Modifier and TypeMethodDescriptionio.grpc.stub.StreamObserver<? super T> delegate()Obtain the wrappedStreamObserver.static <T> io.grpc.stub.StreamObserver<T> ensureSafeObserver(io.grpc.stub.StreamObserver<T> observer) Ensure that the specifiedStreamObserveris a safe observer.voidvoidvoid
-
Method Details
-
onNext
- Specified by:
onNextin interfaceio.grpc.stub.StreamObserver<T>
-
onError
- Specified by:
onErrorin interfaceio.grpc.stub.StreamObserver<T>
-
onCompleted
public void onCompleted()- Specified by:
onCompletedin interfaceio.grpc.stub.StreamObserver<T>
-
delegate
Obtain the wrappedStreamObserver.- Returns:
- the wrapped
StreamObserver
-
ensureSafeObserver
public static <T> io.grpc.stub.StreamObserver<T> ensureSafeObserver(io.grpc.stub.StreamObserver<T> observer) Ensure that the specifiedStreamObserveris a safe observer.If the specified observer is not an instance of
SafeStreamObserverthen wrap it in aSafeStreamObserver.- Type Parameters:
T- the response type expected by the observer- Parameters:
observer- theStreamObserverto test- Returns:
- a safe
StreamObserver
-