_,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"]],["上次更新時間:2025-06-16 (世界標準時間)。"],[[["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."]]],[]]