[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eThis page provides instructions on using legacy bundled services and APIs, specifically within the first-generation runtimes of the App Engine standard environment.\u003c/p\u003e\n"],["\u003cp\u003eA task can be created and sent as a POST request to a designated handler using the \u003ccode\u003ePushTask\u003c/code\u003e class, including the name and action parameters that will be processed by the default queue.\u003c/p\u003e\n"],["\u003cp\u003eMultiple tasks can be added in bulk to a queue by creating \u003ccode\u003ePushTask\u003c/code\u003e objects and using the \u003ccode\u003eaddTasks()\u003c/code\u003e method within the \u003ccode\u003ePushQueue\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eTo utilize the \u003ccode\u003ePushTask\u003c/code\u003e and \u003ccode\u003ePushQueue\u003c/code\u003e classes, you must include specific \u003ccode\u003euse\u003c/code\u003e statements at the beginning of your PHP file.\u003c/p\u003e\n"]]],[],null,["# A PHP Task Queue Example\n\nThe 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:\n| This page describes how to use the legacy bundled services and APIs. This API can only run in first-generation runtimes in the App Engine standard environment. If you are updating to the App Engine PHP 7/8 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/php-differences) to learn about your migration options for legacy bundled services.\n\n\u003cbr /\u003e\n\n $task = new PushTask(\n '/worker',\n ['name' =\u003e 'john doe', 'action' =\u003e 'send_reminder']);\n $task_name = $task-\u003eadd();\n\nYou can also add tasks in bulk to a queue using [PushQueue](/appengine/docs/legacy/standard/php/refdocs/classes/google.appengine.api.taskqueue.PushQueue). In the following example, two [PushTask](/appengine/docs/legacy/standard/php/refdocs/classes/google.appengine.api.taskqueue.PushTask) objects are added to a [PushQueue](/appengine/docs/legacy/standard/php/refdocs/classes/google.appengine.api.taskqueue.PushQueue) using the `addTasks()` method. \n\n $task1 = new PushTask('/someUrl');\n $task2 = new PushTask('/someOtherUrl');\n $queue = new PushQueue();\n $queue-\u003eaddTasks([$task1, $task2]);\n\nWhen you use `PushTask` and `PushQueue`, include these statements at the top of your PHP file: \n\n use google\\appengine\\api\\taskqueue\\PushTask;\n use google\\appengine\\api\\taskqueue\\PushQueue;"]]