Python 2.7 has reached end of support and will be deprecated on January 31, 2026. After deprecation, you won't be able to deploy Python 2.7 applications, even if your organization previously used an organization policy to re-enable deployments of legacy runtimes. Your existing Python 2.7 applications will continue to run and receive traffic after their deprecation date. We recommend that you migrate to the latest supported version of Python.

google.appengine.api.background_thread.background_thread module

Summary

Background Threads API.

An API for creating background threads.

Background threads created using this API do not inherit the context of their creator and do not need to end before the creator request completes.

Contents

google.appengine.api.background_thread.background_thread.start_new_background_thread(target, args, kwargs=None)source

Starts a new background thread.

Creates a new background thread which will call target(*args, **kwargs).

Parameters
  • target – A callable for the new thread to run.

  • args – Position arguments to be passed to target.

  • kwargs – Keyword arguments to be passed to target.

Returns

The thread ID of the background thread.

class google.appengine.api.background_thread.background_thread.BackgroundThread(group=None, target=None, name=None, args=(), kwargs=None, verbose=None)source

Bases: threading.Thread

A threading.Thread-like interface for background threads.

start()source

Starts this background thread.

exception google.appengine.api.background_thread.background_thread.Errorsource

Bases: exceptions.Exception

Base exception class for this module.

exception google.appengine.api.background_thread.background_thread.FrontendsNotSupportedsource

Bases: google.appengine.api.background_thread.background_thread.Error

Error raised when a background thread is requested on a front end.

exception google.appengine.api.background_thread.background_thread.BackgroundThreadLimitReachedErrorsource

Bases: google.appengine.api.background_thread.background_thread.Error

Error raised when no further active background threads can be created.

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年06月16日 UTC.