Represents a single Task on a queue.
def google.appengine.api.labs.taskqueue.taskqueue.Task.__init__ |
( |
|
self, |
|
|
|
payload = None , |
|
|
|
kwargs |
|
) |
| |
Initializer.
All parameters are optional.
Args:
payload: The payload data for this Task that will be delivered to the
webhook as the HTTP request body. This is only allowed for POST and PUT
methods.
countdown: Time in seconds into the future that this Task should execute.
Defaults to zero.
eta: Absolute time when the Task should execute. May not be specified
if 'countdown' is also supplied. This may be timezone-aware or
timezone-naive.
headers: Dictionary of headers to pass to the webhook. Values in the
dictionary may be iterable to indicate repeated header fields.
method: Method to use when accessing the webhook. Defaults to 'POST'.
name: Name to give the Task; if not specified, a name will be
auto-generated when added to a queue and assigned to this object. Must
match the _TASK_NAME_PATTERN regular expression.
params: Dictionary of parameters to use for this Task. For POST requests
these params will be encoded as 'application/x-www-form-urlencoded' and
set to the payload. For all other methods, the parameters will be
converted to a query string. May not be specified if the URL already
contains a query string.
url: Relative URL where the webhook that should handle this task is
located for this application. May have a query string unless this is
a POST method.
retry_options: TaskRetryOptions used to control when the task will be
retried if it fails.
Raises:
InvalidTaskError if any of the parameters are invalid;
InvalidTaskNameError if the task name is invalid; InvalidUrlError if
the task URL is invalid or too long; TaskTooLargeError if the task with
its payload is too large.
def google.appengine.api.labs.taskqueue.taskqueue.Task.add |
( |
|
self, |
|
|
|
queue_name = _DEFAULT_QUEUE , |
|
|
|
transactional = False |
|
) |
| |
Adds this Task to a queue. See Queue.add.
def google.appengine.api.labs.taskqueue.taskqueue.Task.eta |
( |
|
self | ) |
|
Returns a datetime when this Task will execute.
def google.appengine.api.labs.taskqueue.taskqueue.Task.eta_posix |
( |
|
self | ) |
|
Returns a POSIX timestamp giving when this Task will execute.
def google.appengine.api.labs.taskqueue.taskqueue.Task.headers |
( |
|
self | ) |
|
Returns a copy of the headers for this Task.
def google.appengine.api.labs.taskqueue.taskqueue.Task.method |
( |
|
self | ) |
|
Returns the method to use for this Task.
def google.appengine.api.labs.taskqueue.taskqueue.Task.name |
( |
|
self | ) |
|
Returns the name of this Task.
Will be None if using auto-assigned Task names and this Task has not yet
been added to a Queue.
def google.appengine.api.labs.taskqueue.taskqueue.Task.on_queue_url |
( |
|
self | ) |
|
Returns True if this Task will run on the queue's URL.
def google.appengine.api.labs.taskqueue.taskqueue.Task.payload |
( |
|
self | ) |
|
Returns the payload for this task, which may be None.
def google.appengine.api.labs.taskqueue.taskqueue.Task.retry_options |
( |
|
self | ) |
|
Returns the TaskRetryOptions for this task, which may be None.
def google.appengine.api.labs.taskqueue.taskqueue.Task.size |
( |
|
self | ) |
|
Returns the size of this task in bytes.
def google.appengine.api.labs.taskqueue.taskqueue.Task.url |
( |
|
self | ) |
|
Returns the relative URL for this Task.
def google.appengine.api.labs.taskqueue.taskqueue.Task.was_enqueued |
( |
|
self | ) |
|
Returns True if this Task has been enqueued.
Note: This will not check if this task already exists in the queue.
The documentation for this class was generated from the following file:
- code/googleappengine-read-only/python/google/appengine/api/labs/taskqueue/taskqueue.py