A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cloud.google.com/appengine/docs/legacy/standard/python/taskqueue/pull below:

Using Pull Queues in Python 2 | App Engine standard environment for Python 2

Using Pull Queues in Python 2

Stay organized with collections Save and categorize content based on your preferences.

This page provides an overview of pull queues in the App Engine standard environment.

This API is supported for first-generation runtimes and can be used when upgrading to corresponding second-generation runtimes. If you are updating to the App Engine Python 3 runtime, refer to the migration guide to learn about your migration options for legacy bundled services.

In push queues tasks are delivered to a worker service based on the queue's configuration. In pull queues the worker service must ask the queue for tasks. The queue responds by allowing that worker unique access to process the task for a specified period of time, which is called a lease.

Using pull queues, you can also group related tasks using tags and then configure your worker to pull multiple tasks with a certain tag all at once. This process is called batching.

If a worker cannot process a task before its lease expires, it can either renew the lease or let it expire, at which point another worker can acquire it. Once the work associated with a task is complete, the worker must delete it.

Using pull queues requires your code to handle some functions that are automated in push queues:

Scaling your workers
Your code needs to scale the number of workers based on processing volume. If your code does not handle scaling, you risk wasting computing resources if there are no tasks to process; you also risk latency if you have too many tasks to process.
Deleting the tasks
Your code also needs to explicitly delete tasks after processing. In push queues, App Engine deletes the tasks for you. If your worker does not delete pull queue tasks after processing, another worker will re-process the task. This wastes computing resources and risks errors if tasks are not idempotent.

Pull queues in the App Engine standard environment are created by setting a property in a configuration file called queue.yaml.

Pull queue workflow

Workers that process tasks from pull queues must be defined within a service that runs in the App Engine standard environment.

The workflow is as follows:

  1. You create a pull queue, using queue.yaml.
  2. You create tasks and add them to the queue.
  3. The worker you have created leases the task, using TaskQueue.
  4. App Engine sends task data to the worker in the lease response.
  5. The worker processes the task. If the task fails to execute before the lease expires, the worker can modify the lease duration. If the lease expires, the task will be available to be leased to another worker.
  6. After a task is processed successfully, the worker deletes it.
What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["Pull queues in App Engine's standard environment require worker services to actively request tasks, unlike push queues where tasks are automatically delivered."],["Workers using pull queues can utilize batching, which allows them to group related tasks by tags and retrieve them all at once for processing."],["When using pull queues, the worker must handle task scaling and task deletion, as opposed to push queues where these actions are handled by App Engine."],["The process for working with a pull queue involves creating the queue, adding tasks to it, having a worker lease the task for a specified time, processing the task, and then deleting the task once completed."],["Pull queues are created by modifying the `queue.yaml` file."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4