English ▼
Skip to page content Skip to main navigation
e.g. "templates" or "datastore"

# Functions

The `google.appengine.api.taskqueue` package provides the following functions:

add(*args,**kwargs)

  Convenience method that creates a task and adds it to the default queue or a specified queue.

  Arguments:

  *args, **kwargs
    Passed to the `Task` class to create a new instance. Includes the following arguments, all of which are optional:

    name is the name to give the task. If not specified, a name is auto-generated.

    queue_name is the name of the queue to be used for the task. If not specified, the default queue is used.

    url is a relative URL of the web hook that should handle this task. This URL can include a query string (unless this is a POST method). This argument is optional.

    method is the method to be used when accessing the web hook. If not specified, the default is POST.

    headers is a dictionary of headers to pass to the web hook. Values in the dictionary can be iterable to indicate header fields that are repeated. This argument is optional.

    payload is the payload data for this task, to be delivered to the web hook as the body of the HTTP request. This is only allowed for POST and PUT methods. This argument is optional.

    params is a dictionary of parameters to use for this task. For POST requests, the parameters are encoded as `application/x-www-form-urlencoded` and set to the payload. For all other methods, the parameters are converted to a query string. This argument is optional, and isn't allowed if the URL already includes a query string.

    transactional is a Boolean argument. If False, adds the task to a queue whether the enclosing transaction succeeds or fails. If True, raises an exception if called outside a transaction. This argument is optional.

    countdown is a value in seconds that specifies how long to wait before this task is executed. If not specified, defaults to zero.

    eta is an absolute time that specifies when the task should be executed. This value can be time zone aware or naive. This argument is optional, and isn't allowed if countdown is specified.