google.appengine.api.apiproxy_rpc.RPC

Base class for implementing RPC of API proxy stubs.

Inherits From: expected_type

Constructor for the RPC object.

All arguments are optional, and simply set members on the class. These data members will be overriden by values passed to MakeCall.

package string. The package for the call.
call string. The call within the package.
request ProtocolMessage instance. Appropriate for the arguments.
response ProtocolMessage instance. Appropriate for the response.
callback callable. Called when call is complete.
deadline double. Specifies the deadline for this call as the number of seconds from the current time. Ignored if non-positive.
stub APIProxyStub instance. Used in default _WaitImpl to do real call.

exception

state

Methods

CheckSuccess

View source

If there was an exception, raise it now.

Raises
Exception of the API call or the callback, if any.

Clone

View source

Make a shallow copy of this instances attributes, excluding methods.

This is usually used when an RPC has been specified with some configuration options and is being used as a template for multiple RPCs outside of a developer's easy control.

Returns
A clone of this RPC.

MakeCall

View source

Makes an asynchronous (i.e., non-blocking) API call within the specified package for the specified call method.

It will call the _MakeRealCall to do the real job.

Args
package string. The package for the call.
call string. The call within the package.
request ProtocolMessage instance. Appropriate for the arguments.
response ProtocolMessage instance. Appropriate for the response.
callback callable. Called when call is complete.
deadline double. Specifies the deadline for this call as the number of seconds from the current time. Ignored if non-positive.

Raises
TypeError or AssertionError if an argument is of an invalid type. AssertionError or RuntimeError is an RPC is already in use.

Wait

View source

Waits on the API call associated with this RPC.

FINISHING 2
IDLE 0
RUNNING 1