_,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-04-09。"],[[["Workers can lease tasks from a pull queue, which temporarily makes them unavailable to other workers for processing, until the lease expires."],["After processing, the worker must delete the task from the queue to ensure it's not processed again."],["Tasks can be tagged, allowing workers to lease specific tasks based on their tag using the `LeaseByTag` method."],["When polling for tasks, workers should handle back-off errors returned from `taskqueue.Lease` and avoid exceeding 10 LeaseTasks requests per queue per second, to prevent issues with task availability."],["The task queue API discussed is supported for first-generation runtimes, and the page provides information on upgrading to corresponding second-generation runtimes."]]],[]]