View source on GitHub
|
Base class for implementing RPC of API proxy stubs.
Inherits From: expected_type
google.appengine.api.apiproxy_rpc.RPC(
package=None,
call=None,
request=None,
response=None,
callback=None,
deadline=None,
stub=None
)
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.
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.
|
stub
|
APIProxyStub instance. Used in default _WaitImpl to do real
call.
|
Attributes | |
|---|---|
exception
|
|
state
|
|
Methods
CheckSuccess
CheckSuccess()
If there was an exception, raise it now.
| Raises | |
|---|---|
Exception of the API call or the callback, if any.
|
Clone
Clone()
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
MakeCall(
package=None,
call=None,
request=None,
response=None,
callback=None,
deadline=None
)
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
Wait()
Waits on the API call associated with this RPC.
Class Variables | |
|---|---|
| FINISHING |
2
|
| IDLE |
0
|
| RUNNING |
1
|
View source on GitHub