Interesting :) . Would you please elaborate a sample use case that was your 

On Saturday, April 17, 2021 at 3:21:22 PM UTC+5:30 wrote:

> Hello all,
> Recently I've finally found some time to polish and generalize a set of 
> classes providing Guice scopes for gRPC and websockets, that I was 
> copy-pasting-tweaking for every java project for last few years: maybe 
> someone else will find it useful :)
> Provides `rpcScope` and `listenerCallScope`. Oversimplifying, in case of a 
> streaming client, `listenerCallScope` spans over processing of a single 
> message from client's stream, while `rpcScope` spans over a whole given 
> RPC. Oversimplifying again, in case of a unary client, these 2 scopes have 
> roughly the same span.
> Provides
> `requestScope` spans over HTTP servlet requests and websocket events, such 
> as connection open/closed or message received (ie, over each of endpoints' 
> annotated methods or overriding those of Endpoint)
> `websocketConnectionScope` spans over a whole endpoint connection 
> (javax.websocket.Session)
> `httpSessionScope` available both to servlets and websocket endpoints
> both libs are built on top of 
> which automates 
> transferring scopes when dispatching work to new threads (useful for async 
> processing).
> answering in advance why websocket scopes are not built on top of the 
> official servlet scopes:
> - this implementation is thread-safe: a single request can be handled by 
> multiple threads (as long as accessed scoped objects are thread-safe)
> - guice-context-scopes lib was first developed for gRPC scopes. After 
> that, it felt more natural to use it also for websocket scopes, rather than 
> pretend that everything is an HttpServletRequest. I may be biased here 
> however ;-)
> Feedback is welcome :)
> Cheers!

You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To view this discussion on the web visit

Reply via email to