Public Member Functions | List of all members
google.protobuf.service.RpcController Class Reference
Inheritance diagram for google.protobuf.service.RpcController:
Inheritance graph
[legend]

Public Member Functions

def ErrorText (self)
 
def Failed (self)
 
def IsCanceled (self)
 
def NotifyOnCancel (self, callback)
 
def Reset (self)
 
def SetFailed (self, reason)
 
def StartCancel (self)
 

Detailed Description

An RpcController mediates a single method call.

The primary purpose of the controller is to provide a way to manipulate
settings specific to the RPC implementation and to find out about RPC-level
errors. The methods provided by the RpcController interface are intended
to be a "least common denominator" set of features which we expect all
implementations to support.  Specific implementations may provide more
advanced features (e.g. deadline propagation).

Definition at line 118 of file service.py.

Member Function Documentation

◆ ErrorText()

def google.protobuf.service.RpcController.ErrorText (   self)
If Failed is true, returns a human-readable description of the error.

Definition at line 150 of file service.py.

◆ Failed()

def google.protobuf.service.RpcController.Failed (   self)
Returns true if the call failed.

After a call has finished, returns true if the call failed.  The possible
reasons for failure depend on the RPC implementation.  Failed() must not
be called before a call has finished.  If Failed() returns true, the
contents of the response message are undefined.

Definition at line 140 of file service.py.

◆ IsCanceled()

def google.protobuf.service.RpcController.IsCanceled (   self)
Checks if the client cancelled the RPC.

If true, indicates that the client canceled the RPC, so the server may
as well give up on replying to it.  The server should still call the
final "done" callback.

Definition at line 178 of file service.py.

◆ NotifyOnCancel()

def google.protobuf.service.RpcController.NotifyOnCancel (   self,
  callback 
)
Sets a callback to invoke on cancel.

Asks that the given callback be called when the RPC is canceled.  The
callback will always be called exactly once.  If the RPC completes without
being canceled, the callback will be called after completion.  If the RPC
has already been canceled when NotifyOnCancel() is called, the callback
will be called immediately.

NotifyOnCancel() must be called no more than once per request.

Definition at line 187 of file service.py.

◆ Reset()

def google.protobuf.service.RpcController.Reset (   self)
Resets the RpcController to its initial state.

After the RpcController has been reset, it may be reused in
a new call. Must not be called while an RPC is in progress.

Definition at line 132 of file service.py.

◆ SetFailed()

def google.protobuf.service.RpcController.SetFailed (   self,
  reason 
)
Sets a failure reason.

Causes Failed() to return true on the client side.  "reason" will be
incorporated into the message returned by ErrorText().  If you find
you need to return machine-readable information about failures, you
should incorporate it into your response protocol buffer and should
NOT call SetFailed().

Definition at line 167 of file service.py.

◆ StartCancel()

def google.protobuf.service.RpcController.StartCancel (   self)
Initiate cancellation.

Advises the RPC system that the caller desires that the RPC call be
canceled.  The RPC system may cancel it immediately, may wait awhile and
then cancel it, or may not even cancel the call at all.  If the call is
canceled, the "done" callback will still be called and the RpcController
will indicate that the call failed at that time.

Definition at line 154 of file service.py.


The documentation for this class was generated from the following file:


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:10