PushTask
class PushTask (View source)
A PushTask encapsulates a unit of work that an application places onto a Push Queue for asynchronous 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
MAX_DELAY_SECONDS |
A task may be scheduled up to 30 days into the future. |
MAX_NAME_LENGTH |
|
MAX_TASK_SIZE_BYTES |
|
MAX_URL_LENGTH |
|
NAME_PATTERN |
|
Methods
Construct a PushTask.
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.
Return the task's query data.
Return the task's name if it was explicitly named.
Return the task's execution delay, in seconds.
Return the task's HTTP method.
Return the task's headers.
Adds the task to a queue.
Details
at line 110
__construct(string $url_path, array $query_data = [], array $options = [])
Construct a PushTask.
at line 223
string
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.
at line 232
array
getQueryData()
Return the task's query data.
at line 242
string
getName()
Return the task's name if it was explicitly named.
at line 251
float
getDelaySeconds()
Return the task's execution delay, in seconds.
at line 261
string
getMethod()
Return the task's HTTP method.
at line 274
string[]
getHeaders()
Return the task's headers.
at line 290
string
add($queue_name = 'default')
Adds the task to a queue.