I'm new to GRPC and am unsure how to handle server streaming correctly if a
client terminates.
Currently I have server streaming which gets content from a LifoQueue and
streams the content of the queue to some connected client. Each client has
an id (in request.id) which gets the correct queue for this client:
...
def addMsg(self,id, msg): # producer
queues[id].put(msg)
def stream(self, request, context): # consumer
queues[request.id] = LifoQueue()
while True:
message = queues[request.id].get(block=True)
yield message
...
The stream method gets called from the client - however if the client
terminates, can I be sure that the server side also terminates this call
eventually or does this need to be managed differently?
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/3a284666-c3de-4b5a-b28c-e51f42579e16n%40googlegroups.com.