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
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?