A question about the solution for Context / Scoped Beans #374
Labels
feedback required
Information are missing or feedback for suggestions is requested
question
A question about this library or its usage
The context
As the doc said "In grpc-java different steps in the message delivery / request process can and will run in different threads. This is
not only but especially relevant for streaming calls. Avoid using
ThreadLocal
s inside yourServerInterceptor
s andgrpc service method implementations (in the entire grpc context). When it comes down to it, the preparation phase, every
single message and the completion phase might run in different threads. If you wish to store data for the duration of
the session, do so either using grpc's
Context
orgrpcRequest
scoped beans."So you defined the
GrpcRequestScope
.The question
But I look up the source code, The Only Implement for
io.grpc.Context.Storage
isio.grpc.ThreadLocalContextStorage
. This is also based on ThreadLocal.So how can it useful for ** different steps use different threads** ??
If this question could be picked , I will be very grateful. Thank you
The text was updated successfully, but these errors were encountered: