StreamObservers

public class StreamObservers

A utility class for the routines related to gRPC StreamObserver instances.

Functions

Link copied to clipboard
public static void ack(StreamObserver<Response> responseObserver)
A utility method which sends acknowledgement to the client via the responseObserver provided and completes the response.
Link copied to clipboard
public static StreamObserver<T> forwardErrorsOnly<T>(StreamObserver<?> delegate)
Wraps the given delegate into a StreamObserver and proxies only errors to it.
Link copied to clipboard
public static Optional<Error> fromStreamError(Throwable throwable)
Extracts a system error from the Throwable received on a client-side as a result of a failed gRPC call to server-side routines.
Link copied to clipboard
Creates an instance of observer which memoizes the responses.
Link copied to clipboard
public static StreamObserver<T> noOpObserver<T>()
Creates a observer which does nothing upon the invocation of its callback methods.