App Engine PHP SDK  v1 rev.445
The PHP runtime is available as an experimental Preview feature.
Public Member Functions | Public Attributes | List of all members
google\appengine\api\taskqueue\PushTask Class Reference

Public Member Functions

 __construct ($url_path, $query_data=[], $options=[])
 
 getUrl ()
 
 getQueryData ()
 
 getName ()
 
 getDelaySeconds ()
 
 getMethod ()
 
 getHeaders ()
 
 add ($queue_name= 'default')
 

Public Attributes

const MAX_DELAY_SECONDS = 2592000
 
const MAX_NAME_LENGTH = 500
 
const MAX_TASK_SIZE_BYTES = 102400
 
const MAX_URL_LENGTH = 2083
 
const NAME_PATTERN = '/^[a-zA-Z0-9_-]+$/'
 

Detailed Description

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.

Constructor & Destructor Documentation

google\appengine\api\taskqueue\PushTask::__construct (   $url_path,
  $query_data = [],
  $options = [] 
)

Construct a PushTask.

Parameters
string$url_pathThe path of the URL handler for this task relative to your application's root directory.
array$query_dataThe 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.
array$optionsAdditional 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.

Member Function Documentation

google\appengine\api\taskqueue\PushTask::add (   $queue_name = 'default')

Adds the task to a queue.

Parameters
string$queueThe name of the queue to add to. Defaults to 'default'.
Returns
string The name of the task.
Exceptions
TaskAlreadyExistsExceptionif a task of the same name already exists in the queue.
TaskQueueExceptionif there was a problem using the service.
google\appengine\api\taskqueue\PushTask::getDelaySeconds ( )

Return the task's execution delay, in seconds.

Returns
float The task's execution delay in seconds.
google\appengine\api\taskqueue\PushTask::getHeaders ( )

Return the task's headers.

Returns
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.
google\appengine\api\taskqueue\PushTask::getMethod ( )

Return the task's HTTP method.

Returns
string The task's HTTP method, i.e. one of 'DELETE', 'GET', 'HEAD', 'POST', 'PUT'.
google\appengine\api\taskqueue\PushTask::getName ( )

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

Returns
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.
google\appengine\api\taskqueue\PushTask::getQueryData ( )

Return the task's query data.

Returns
array The task's query data.
google\appengine\api\taskqueue\PushTask::getUrl ( )

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
string The task's URL path.

Member Data Documentation

const google\appengine\api\taskqueue\PushTask::MAX_DELAY_SECONDS = 2592000

A task may be scheduled up to 30 days into the future.


The documentation for this class was generated from the following file: