Hi,
Using Python gRPC, I would like to be able to cancel a long-running unary-stream call from the client side, when a `threading.Event` is set.
def application(stub: StreamsStub, event: threading.Event):
stream = stub.Application(ApplicationStreamRequest())
try:
for resp in stream:
print(resp)
except grpc.RpcError as e:
print(e)
For the time being I am cancelling the stream using the `channel.close()` method, but of course this closes all connections rather than just this stream.
Could someone suggest how I can use the event to cancel the stream iterator?
Thanks, Mark