The following code creates a task that will be sent as a POST request to the /worker
handler of the application. The task contains name and action data, and will be processed by the default queue:
You can also add tasks in bulk to a queue using PushQueue. In the following example, two PushTask objects are added to a PushQueue using the addTasks()
method.
When you use PushTask
and PushQueue
, include these statements at the top of your PHP file: