Python 2.7 has reached end of supportand will bedeprecatedon January 31, 2026. After deprecation, you won't be able to deploy Python 2.7applications, even if your organization previously used an organization policy tore-enable deployments of legacy runtimes. Your existing Python2.7 applications will continue to run and receive traffic after theirdeprecation date. We recommend thatyoumigrate to the latest supported version of Python.

Using Push Queues in Python 2

This page provides an overview of push queues. Push queues run tasks bydispatching HTTP requests to App Engine worker services. The requests aredelivered at a constant rate. If a task fails, the service retries the task,sending another request. You must provide a handler for every kind of task youuse. A single service can have multiple handlers for different kinds of tasks, oryou can use different services to manage different task types.

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

The application offloads the task to the task queue service, which uses HTTP tosend it to the worker

The task deadline

When a worker service receives a push task request, it must handle the requestand send an HTTP response before a deadline that depends on thescalingtypeof the worker service.

Automatic scaling services must finish before 10 minutes have elapsed.Manual and basic scaling services can run up to 24 hours.

An HTTP response code between 200–299 indicates success; all other valuesindicate the task failed. If the task fails to respond within the deadline, orreturns an invalid response value, the task is retried.

Retrying a failed task

If a push task request handler returns an HTTP status code outside the range200–299, or fails to return any response before the task deadline occurs, the queueretries the task until it succeeds. The system backs off gradually toavoid flooding your application with too many requests, but schedules retryattempts for failed tasks to recur at a minimum of once per hour.

Working with push queues

When working with push queues, at a minimum, you'll need to do the following things:

  • Create tasksprogrammaticallyand add them to the default push queue, or to one or more named push queues thatyou have created.
  • Write ahandlerthat processes a task's request, and assign the handler to an App Engineservice.

Optionally, you can also:

When you use push queues, your application is subject to additionalquotas.

What's next

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

Last updated 2025-12-15 UTC.