Interface GrpcLifecycleObserver

All Superinterfaces:
HttpLifecycleObserver
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface GrpcLifecycleObserver extends HttpLifecycleObserver
An observer interface that provides visibility into gRPC lifecycle events.

In order to deliver events at accurate time, callbacks on this interface can be invoked from the IoExecutor. Implementation of this observer must be non-blocking. If the consumer of events may block (uses a blocking library or logger configuration is not async), it has to offload publications to another Executor after capturing timing of events. If blocking code is executed inside callbacks without offloading, it will negatively impact IoExecutor.

To install this observer for the server use GrpcServerBuilder.lifecycleObserver(GrpcLifecycleObserver). For the client use io.servicetalk.grpc.netty.GrpcLifecycleObserverRequesterFilter as argument to SingleAddressHttpClientBuilder.appendClientFilter(StreamingHttpClientFilterFactory) which can be configured using GrpcClientBuilder.initializeHttp(GrpcClientBuilder.HttpInitializer).