[[["易于理解","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\u003ePush queues manage tasks by sending HTTP requests to App Engine worker services at a consistent rate, retrying any failed tasks.\u003c/p\u003e\n"],["\u003cp\u003eWorker services must respond to push task requests with an HTTP status code between 200-299 within a specific deadline, which varies from 10 minutes for automatic scaling to 24 hours for manual or basic scaling.\u003c/p\u003e\n"],["\u003cp\u003eUsing push queues involves creating tasks and assigning them to queues, along with writing handlers within an App Engine service to process these tasks.\u003c/p\u003e\n"],["\u003cp\u003eYou can customize push queues to effectively perform various tasks, as well as monitor and manage these queues through the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003ePush queues are supported for first-generation runtimes, with a migration path for users upgrading to second-generation runtimes, requiring a review of the migration options for legacy bundled services.\u003c/p\u003e\n"]]],[],null,["# Using Push Queues in Go\n\nThis page provides an overview of push queues. Push queues run tasks by\ndispatching HTTP requests to App Engine worker services. The requests are\ndelivered at a constant rate. If a task fails, the service retries the task,\nsending another request. You must provide a handler for every kind of task you\nuse. A single service can have multiple handlers for different kinds of tasks, or\nyou can use different services to manage different task types.\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| go\n| /services/access). If you are updating to the App Engine Go 1.12+ runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/go-differences) to learn about your migration options for legacy bundled services.\n\nThe task deadline\n-----------------\n\nWhen a worker service receives a push task request, it must handle the request\nand send an HTTP response before a deadline that depends on the [scaling\ntype](/appengine/docs/legacy/standard/go111/an-overview-of-app-engine#instances)\nof the worker service.\n\nAutomatic scaling services must finish before 10 minutes have elapsed.\nManual and basic scaling services can run up to 24 hours.\n\nAn HTTP response code between 200--299 indicates success; all other values\nindicate the task failed. If the task fails to respond within the deadline, or\nreturns an invalid response value, the task is retried.\n\nRetrying a failed task\n----------------------\n\nIf a push task request handler returns an HTTP status code outside the range\n200--299, or fails to return any response before the task deadline occurs, the queue\nretries the task until it succeeds. The system backs off gradually to\navoid flooding your application with too many requests, but schedules retry\nattempts for failed tasks to recur at a minimum of once per hour.\n\nWorking with push queues\n------------------------\n\nWhen working with push queues, at a minimum, you'll need to do the following things:\n\n- [Create tasks\n programmatically](/appengine/docs/legacy/standard/go111/taskqueue/push/creating-tasks) and add them to the default push queue, or to one or more named push queues that you have created.\n- [Write a\n handler](/appengine/docs/legacy/standard/go111/taskqueue/push/creating-handlers) that processes a task's request, and assign the handler to an App Engine service.\n\nOptionally, you can also:\n\n- [Create and customize multiple\n queues](/appengine/docs/legacy/standard/go111/taskqueue/push/creating-push-queues) to perform multiple tasks efficiently.\n- [Monitor and manage](/appengine/docs/legacy/standard/go111/taskqueue/push/creating-push-queues#monitoring_queues_in_the_console_name_short) your push queues in the Google Cloud console.\n\nWhen you use push queues, your application is subject to additional\n[quotas](/appengine/docs/quotas#Task_Queue).\n\nWhat's next\n-----------\n\n- Learn how to [create push queues](/appengine/docs/legacy/standard/go111/taskqueue/push/creating-push-queues)\n- Learn how to [create tasks](/appengine/docs/legacy/standard/go111/taskqueue/push/creating-tasks)\n- Learn about [writing handlers](/appengine/docs/legacy/standard/go111/taskqueue/push/creating-handlers)\n- Look at an [example](/appengine/docs/legacy/standard/go111/taskqueue/push/example)"]]