Package pl.morgwai.base.grpc.utils
-
Interface Summary Interface Description DispatchingOnReadyHandler.ThrowingFunction<ParamT,ResultT> -
Class Summary Class Description BlockingResponseObserver<T> Response observer for a client side that blocks until response is completed with eitherBlockingResponseObserver.onCompleted()
orBlockingResponseObserver.onError(Throwable)
.ConcurrentRequestObserver<RequestT,ResponseT> A requestStreamObserver
for bi-di streaming methods that dispatch work to multiple threads and don't care about the order of responses.DispatchingOnReadyHandler<ResponseT> Handles streaming of messages to aCallStreamObserver
from multiple threads with respect to flow-control to ensure that no excessive buffering occurs.FakeResponseObserver<ResponseT> A fakeServerCallStreamObserver
testing helper class.FakeResponseObserver.FailureTrackingThreadPoolExecutor Tracks task scheduling failures, occurring mainly on attempts to execute a task after the executor was shutdown.FakeResponseObserver.FailureTrackingThreadPoolExecutor.SubmissionFailure GrpcServerFlow A very simplified overview of gRPC server flow:
AServerCallHandler
for a given method is created, depending on client type eitherServerCalls.StreamingServerCallHandler
orServerCalls.UnaryServerCallHandler
(ie:Streaming
/Unary
prefix refers to client's type (Server
refers toCall
), naming scheme here is not intuitive...).
When a call is receivedServerCallHandler.startCall(ServerCall, Metadata)
is called in intercepter chain, which returns aServerCall.Listener
, respectively eitherServerCalls.StreamingServerCallHandler.StreamingServerCallListener
orServerCalls.UnaryServerCallHandler.UnaryServerCallListener
.
Streaming client flow:
ServerCalls.StreamingServerCallHandler#startCall(ServerCall, Metadata)
callsServerCalls.StreamingRequestMethod#invoke(StreamObserver)
which calls user's code to obtain requestStreamObserver
, which is then passed to constructor ofServerCalls.StreamingServerCallHandler.StreamingServerCallListener
.OrderedConcurrentRequestObserver<RequestT,ResponseT> AConcurrentRequestObserver
that usesOrderedConcurrentOutputBuffer
to automatically ensure that response messages are sent in order corresponding to request messages order. -
Exception Summary Exception Description BlockingResponseObserver.ErrorReportedException