Re: [grpc-io] Grpc Java server test for ServerInterceptors

2023-11-28 Thread 'Eric Anderson' via grpc.io
On Mon, Nov 27, 2023 at 3:02 PM John Wilson wrote: > Is this implementation correct? > Looks fine. Is this thread safe? > Context is immutable (although the values could be mutable, but then you'd be responsible for synchronization). And the "current" Context is stored in a ThreadLocal. So,

[grpc-io] Grpc Java server test for ServerInterceptors

2023-11-27 Thread John Wilson
Hi Grpc team! I have a ServerInterceptor instance for my grpc server, it does something like this: @Override public ServerCall.Listener interceptCall( ServerCall call, Metadata headers, ServerCallHandler next) { Context context = Context.current(); // more

[grpc-io] Grpc Java server test for ServerInterceptors

2023-11-27 Thread John Wilson
Hi Grpc team! I have a ServerInterceptor instance for my grpc server, it does something like this: @Override public ServerCall.Listener interceptCall( ServerCall call, Metadata headers, ServerCallHandler next) { Context context = Context.current(); //

Re: [grpc-io] Grpc Java server test for ServerInterceptors

2023-11-07 Thread 'Larry Safran' via grpc.io
Hi Edu, Yes, that implementation looks good. We have an example that does something similar: https://github.com/grpc/grpc-java/tree/master/examples/example-oauth ServerInterceptors are called sequentially by a single thread, so it will be thread safe. Additionally, Context objects are

[grpc-io] Grpc Java server test for ServerInterceptors

2023-11-07 Thread Eduwer Camacaro
Hi Grpc team! I have a ServerInterceptor instance for my grpc server, it does something like this: @Override public ServerCall.Listener interceptCall( ServerCall call, Metadata headers, ServerCallHandler next) { Context context = Context.current(); // more