Public Member Functions | |
def | add_callback (self, callback) |
def | cancel (self) |
def | is_active (self) |
def | time_remaining (self) |
Provides RPC-related information and action.
Definition at line 309 of file src/python/grpcio/grpc/__init__.py.
def grpc.RpcContext.add_callback | ( | self, | |
callback | |||
) |
Registers a callback to be called on RPC termination. Args: callback: A no-parameter callable to be called on RPC termination. Returns: True if the callback was added and will be called later; False if the callback was not added and will not be called (because the RPC already terminated or some other reason).
Reimplemented in grpc._interceptor._FailureOutcome, grpc._channel._Rendezvous, grpc_testing._channel._invocation.ResponseIteratorCall, grpc._server._Context, grpc_testing._channel._invocation._FutureCall, grpc._interceptor._UnaryOutcome, grpc_testing._channel._invocation._RpcErrorCall, grpc_testing._channel._invocation._Call, and grpc_testing._server._servicer_context.ServicerContext.
Definition at line 342 of file src/python/grpcio/grpc/__init__.py.
def grpc.RpcContext.cancel | ( | self | ) |
Cancels the RPC. Idempotent and has no effect if the RPC has already terminated.
Reimplemented in grpc._channel._Rendezvous, grpc._channel._InactiveRpcError, grpc_testing._channel._invocation.ResponseIteratorCall, grpc._server._Context, grpc_testing._channel._invocation._FutureCall, grpc._interceptor._UnaryOutcome, grpc._interceptor._FailureOutcome, grpc_testing._channel._invocation._RpcErrorCall, grpc_testing._channel._invocation._Call, and grpc_testing._server._servicer_context.ServicerContext.
Definition at line 334 of file src/python/grpcio/grpc/__init__.py.
def grpc.RpcContext.is_active | ( | self | ) |
Describes whether the RPC is active or has terminated. Returns: bool: True if RPC is active, False otherwise.
Reimplemented in grpc._channel._Rendezvous, grpc_testing._channel._invocation.ResponseIteratorCall, grpc._server._Context, grpc_testing._channel._invocation._FutureCall, grpc._interceptor._UnaryOutcome, grpc._interceptor._FailureOutcome, grpc_testing._channel._invocation._RpcErrorCall, grpc_testing._channel._invocation._Call, and grpc_testing._server._servicer_context.ServicerContext.
Definition at line 313 of file src/python/grpcio/grpc/__init__.py.
def grpc.RpcContext.time_remaining | ( | self | ) |
Describes the length of allowed time remaining for the RPC. Returns: A nonnegative float indicating the length of allowed time in seconds remaining for the RPC to complete before it is considered to have timed out, or None if no deadline was specified for the RPC.
Reimplemented in grpc._channel._Rendezvous, grpc_testing._channel._invocation.ResponseIteratorCall, grpc._server._Context, grpc_testing._channel._invocation._FutureCall, grpc._interceptor._UnaryOutcome, grpc._interceptor._FailureOutcome, grpc_testing._channel._invocation._RpcErrorCall, grpc_testing._channel._invocation._Call, and grpc_testing._server._servicer_context.ServicerContext.
Definition at line 323 of file src/python/grpcio/grpc/__init__.py.