Hi, I am adding a remote component to my github.com/robaho/keydb 
<http://github.com/robaho/keydb> project and decided to use gRPC.

I’ve reviewed the docs, and it appears to want to be stateless - which given 
the nature of Google makes sense.

But for something like a database connection, where there could be substantial 
connection setup costs that you wouldn’t want to pay on every request, what is 
the best way to accomplish this with gRPC?

There are issues like https://github.com/grpc/grpc-go/issues/297 
<https://github.com/grpc/grpc-go/issues/297> that are closed with no resolution 
???

There doesn’t seem to be a way to access the connection state on the server - 
to know the associated user, register a close handler, etc.

The only solutions I see is are

1) that the client must send heartbeat message, if the server doesn’t receive a 
heartbeat in X, clean-up the connection, AND the client must send a 
connectionID along with every request (but even this seems problematic for 
security reasons).

2) use the bidirectional streaming mode, and so the connection is treated as 
one long stream of messages in and out, and when the rpc finishes the 
connection is cleaned up

Is there an example of this type of usage someone can point me to?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to