Public Member Functions | |
def | __init__ (self, response, call) |
def | add_callback (self, callback) |
def | add_done_callback (self, fn) |
def | cancel (self) |
def | cancelled (self) |
def | code (self) |
def | details (self) |
def | done (self) |
def | exception (self, ignored_timeout=None) |
def | initial_metadata (self) |
def | is_active (self) |
def | result (self, ignored_timeout=None) |
def | running (self) |
def | time_remaining (self) |
def | traceback (self, ignored_timeout=None) |
def | trailing_metadata (self) |
Private Attributes | |
_call | |
_response | |
Definition at line 150 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.__init__ | ( | self, | |
response, | |||
call | |||
) |
Definition at line 152 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.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 from grpc.RpcContext.
Definition at line 177 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.add_done_callback | ( | self, | |
fn | |||
) |
Adds a function to be called at completion of the computation. The callback will be passed this Future object describing the outcome of the computation. Callbacks will be invoked after the future is terminated, whether successfully or not. If the computation has already completed, the callback will be called immediately. Exceptions raised in the callback will be logged at ERROR level, but will not terminate any threads of execution. Args: fn: A callable taking this Future object as its single parameter.
Reimplemented from grpc.Future.
Definition at line 198 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.cancel | ( | self | ) |
Attempts to cancel the computation. This method does not block. Returns: bool: Returns True if the computation was canceled. Returns False under all other circumstances, for example: 1. computation has begun and could not be canceled. 2. computation has finished 3. computation is scheduled for execution and it is impossible to determine its state without blocking.
Reimplemented from grpc.Future.
Definition at line 174 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.cancelled | ( | self | ) |
Describes whether the computation was cancelled. This method does not block. Returns: bool: Returns True if the computation was cancelled before its result became available. Returns False under all other circumstances, for example: 1. computation was not cancelled. 2. computation's result is available.
Reimplemented from grpc.Future.
Definition at line 180 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.code | ( | self | ) |
Accesses the status code sent by the server. This method blocks until the value is available. Returns: The StatusCode value for the RPC.
Reimplemented from grpc.Call.
Definition at line 162 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.details | ( | self | ) |
Accesses the details sent by the server. This method blocks until the value is available. Returns: The details string of the RPC.
Reimplemented from grpc.Call.
Definition at line 165 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.done | ( | self | ) |
Describes whether the computation has taken place. This method does not block. Returns: bool: Returns True if the computation already executed or was cancelled. Returns False if the computation is scheduled for execution or currently executing. This is exactly opposite of the running() method's result.
Reimplemented from grpc.Future.
Definition at line 186 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.exception | ( | self, | |
timeout = None |
|||
) |
Return the exception raised by the computation. This method may return immediately or may block. Args: timeout: The length of time in seconds to wait for the computation to terminate or be cancelled. If None, the call will block until the computations's termination. Returns: The exception raised by the computation, or None if the computation did not raise an exception. Raises: FutureTimeoutError: If a timeout value is passed and the computation does not terminate within the allotted time. FutureCancelledError: If the computation was cancelled.
Reimplemented from grpc.Future.
Definition at line 192 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.initial_metadata | ( | self | ) |
Accesses the initial metadata sent by the server. This method blocks until the value is available. Returns: The initial :term:`metadata`.
Reimplemented from grpc.Call.
Definition at line 156 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.is_active | ( | self | ) |
Describes whether the RPC is active or has terminated. Returns: bool: True if RPC is active, False otherwise.
Reimplemented from grpc.RpcContext.
Definition at line 168 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.result | ( | self, | |
timeout = None |
|||
) |
Returns the result of the computation or raises its exception. This method may return immediately or may block. Args: timeout: The length of time in seconds to wait for the computation to finish or be cancelled. If None, the call will block until the computations's termination. Returns: The return value of the computation. Raises: FutureTimeoutError: If a timeout value is passed and the computation does not terminate within the allotted time. FutureCancelledError: If the computation was cancelled. Exception: If the computation raised an exception, this call will raise the same exception.
Reimplemented from grpc.Future.
Definition at line 189 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.running | ( | self | ) |
Describes whether the computation is taking place. This method does not block. Returns: Returns True if the computation is scheduled for execution or currently executing. Returns False if the computation already executed or was cancelled.
Reimplemented from grpc.Future.
Definition at line 183 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.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 from grpc.RpcContext.
Definition at line 171 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.traceback | ( | self, | |
timeout = None |
|||
) |
Access the traceback of the exception raised by the computation. This method may return immediately or may block. Args: timeout: The length of time in seconds to wait for the computation to terminate or be cancelled. If None, the call will block until the computation's termination. Returns: The traceback of the exception raised by the computation, or None if the computation did not raise an exception. Raises: FutureTimeoutError: If a timeout value is passed and the computation does not terminate within the allotted time. FutureCancelledError: If the computation was cancelled.
Reimplemented from grpc.Future.
Definition at line 195 of file _interceptor.py.
def grpc._interceptor._UnaryOutcome.trailing_metadata | ( | self | ) |
Accesses the trailing metadata sent by the server. This method blocks until the value is available. Returns: The trailing :term:`metadata`.
Reimplemented from grpc.Call.
Definition at line 159 of file _interceptor.py.
|
private |
Definition at line 154 of file _interceptor.py.
|
private |
Definition at line 153 of file _interceptor.py.