_,err=taskqueue.Add(ctx,&taskqueue.Task{Payload:[]byte("parse"),Method:"PULL",Tag:"parse",},"pull-queue")_,err=taskqueue.Add(ctx,&taskqueue.Task{Payload:[]byte("render"),Method:"PULL",Tag:"render",},"pull-queue")// leases render tasks, but not parsetasks,err=taskqueue.LeaseByTag(ctx,100,"pull-queue",3600,"render")// Leases up to 100 tasks that have same tag.// Tag is that of "oldest" task by ETA.tasks,err=taskqueue.LeaseByTag(ctx,100,"pull-queue",3600,"")
[[["易于理解","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-08-20。"],[[["\u003cp\u003eWorkers can lease tasks from a pull queue, which temporarily makes them unavailable to other workers for processing, until the lease expires.\u003c/p\u003e\n"],["\u003cp\u003eAfter processing, the worker must delete the task from the queue to ensure it's not processed again.\u003c/p\u003e\n"],["\u003cp\u003eTasks can be tagged, allowing workers to lease specific tasks based on their tag using the \u003ccode\u003eLeaseByTag\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eWhen polling for tasks, workers should handle back-off errors returned from \u003ccode\u003etaskqueue.Lease\u003c/code\u003e and avoid exceeding 10 LeaseTasks requests per queue per second, to prevent issues with task availability.\u003c/p\u003e\n"],["\u003cp\u003eThe task queue API discussed is supported for first-generation runtimes, and the page provides information on upgrading to corresponding second-generation runtimes.\u003c/p\u003e\n"]]],[],null,[]]