• Home
  • Raw
  • Download

Lines Matching +full:cancel +full:- +full:in +full:- +full:progress

3 In the example, we implement a silly algorithm. We search for bytestrings whose
10 In particular, we ensure that client processes cancel the stream explicitly
11 before terminating and we ensure that server processes cancel RPCs that have gone on longer
16 A client may cancel an RPC for several reasons. Perhaps the data it requested
20 ##### Cancelling a Server-Side Unary RPC from the Client
32 to be executed when the RPC completes, or to cancel the RPC before it has
35 In the example, we use this interface to cancel our in-progress RPC when the
36 user interrupts the process with ctrl-c.
42 future.cancel()
55 ##### Cancelling a Server-Side Streaming RPC from the Client
57 Cancelling a Server-side streaming RPC is even simpler from the perspective of
66 result_generator.cancel()
69 for result in result_generator:
79 A server is responsible for cancellation in two ways. It must respond in some way
80 when a client initiates a cancellation, otherwise long-running computations
83 It may also decide to cancel the RPC for its own reasons. In our example, the
84 server can be configured to cancel an RPC after a certain number of hashes has
85 been computed in order to conserve compute resources.
95 In this example, we use the `ServicerContext.add_callback` method to set a
112 `ServicerContext.cancel()`.
114 In our example, we ensure that no single client is monopolizing the server by
119 for candidate in secret_generator:
123 context.cancel()
126 In this type of situation, you may also consider returning a more specific error
127 using the [`grpcio-status`](https://pypi.org/project/grpcio-status/) package.