Hi there,
let’s say I have the following interface:
service S {
rpc Foo(FooRequest) returns (FooResponse);
}
In Foo(), I authenticate the client using a user/password passed as
metadata before executing the FooRequest. Authenticating the client
each time is expensive, so I want to remember somewhere that I already
authenticated this client (for this discussion let’s ignore security
considerations like caching policy etc). I can’t return a session ID
or something like that to the client, I just receive the user/pass
each time.
My thinking was to cache this information somewhere in the transport,
but there’s a small twist: I need to clean up something whenever the
transport goes down. I can’t tie this to the Stream because this is
not a streaming RPC so each call to Foo() has its own single-use
stream in the context. I can get access to the transport
(*transport.http2Server), but I can’t access its private shutdownChan
to wait for the transport to be closed.
So what’s the best way (if any) to tie something to the lifetime to
the transport?
--
Benoit "tsuna" Sigoure
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/CAFKYj4eqC0XCbLvgc6aSG_B0ndhzKDw2rpaZdGoZyBX0sTsSBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.