--
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 grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
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/185a533b-da4d-4cf7-8f26-4e23b59f6439%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
In order to cancel a call from Python, you need to use the asynchronous API.It should look something like this:call_future = stub.SomeUnaryStream.future(input_msg)call_future.cancel()Note that if you have a long running server process, you will need to explicitly check if the call has been cancelled from the server.
On Thu, Oct 27, 2016 at 10:54 AM, <flazz...@gmail.com> wrote:
Hi,In a Python grpc client & server. Given some unary-stream rpc call:call = stub.SomeUnaryStream(input_msg)xs = itertools.islice(call, 2) # take twocall.cancel() # this doesn't seem to signal the serverHow can I signal to the server that the call is over, and resources can be freed? The call is cancelled on the client side, but I get no notification until a GeneratorExit is thrown during a subsequent call. I assume the server-side GC is cleaning up and closing the generator. I made a golang client to see if the CloseSend method would signal but the behavior is similar.Am I missing something here? or is the api incomplete?-Franco
--
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 grpc-io+u...@googlegroups.com.
I ended up checking context.is_active() in a separate thread on the server. That thread signals the cleanup when ,is_active() returns False.