Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



google/appengine/api/taskqueue/PushTask.php

Table of Contents
Copyright 2007 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

\google\appengine\api\taskqueue\PushTask

Package: Default
A PushTask encapsulates a unit of work that an application places onto a Push Queue for asnychronous execution.

The queue executes that work by sending the task back to the application in the form of an HTTP request to one of the application's handlers. This class is immutable.

Constants

> V Constant MAX_DELAY_SECONDS = 2592000
A task may be scheduled up to 30 days into the future.
> V Constant MAX_NAME_LENGTH = 500
> V Constant MAX_TASK_SIZE_BYTES = 102400
> V Constant MAX_URL_LENGTH = 2083
> V Constant NAME_PATTERN = '/^[a-zA-Z0-9_-]+$/'

Methods

method public __construct (string $url_path, array $query_data = array(), array $options = array()) : void

Construct a PushTask.

Parameters
Name Type Description
$url_path string

The path of the URL handler for this task relative to your application's root directory.

$query_data array

The data carried by task, typically in the form of a set of key value pairs. This data will be encoded using http_build_query() and will be either:

  • Added to the payload of the http request if the task's method is POST or PUT.
  • Added to the URL if the task's method is GET, HEAD, or DELETE.
$options array

Additional options for the task. Valid options are:

  • 'method': string One of 'POST', 'GET', 'HEAD', 'PUT', 'DELETE'. Default value: 'POST'.
  • 'name': string Name of the task. Defaults to '' meaning the service will generate a unique task name.
  • 'delay_seconds': float The minimum time to wait before executing the task. Default: zero.
  • 'header': string Additional headers to be sent when the task executes.
method public add ( $queue_name = 'default') : string

Adds the task to a queue.

Parameters
Name Type Description
$queue_name
Returns
Type Description
string The name of the task.
Throws
Exception Description
\google\appengine\api\taskqueue\TaskAlreadyExistsException if a task of the same name already exists in the queue.
\google\appengine\api\taskqueue\TaskQueueException if there was a problem using the service.
method public getDelaySeconds () : float

Return the task's execution delay, in seconds.

Returns
Type Description
float The task's execution delay in seconds.
method public getHeaders () : string[]

Return the task's headers.

Returns
Type Description
string[] The headers that will be sent when the task is executed. This list is not exhaustive as the backend may add more headers at execution time. The array is numerically indexed and of the same format as that returned by the standard headers_list() function.
method public getMethod () : string

Return the task's HTTP method.

Returns
Type Description
string The task's HTTP method, i.e. one of 'DELETE', 'GET', 'HEAD', 'POST', 'PUT'.
method public getName () : string

Return the task's name if it was explicitly named.

Returns
Type Description
string The task's name if it was explicity named, or empty string if it will be given a uniquely generated name in the queue.
method public getQueryData () : array

Return the task's query data.

Returns
Type Description
array The task's query data.
method public getUrl () : string

Return the task's URL.

This will be the task's URL path, plus any query parameters if the task's method is GET, HEAD, or DELETE.

Returns
Type Description
string The task's URL path.
Documentation was generated by phpDocumentor 2.0.0a12 .