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.
Stay organized with collections
Save and categorize content based on your preferences.
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.
ReturnsThe 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.
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.
[[["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-06-16 UTC."],[[["This module provides an API for creating and managing background threads within the Google App Engine environment."],["Background threads do not inherit the context of their creator and can continue running even after the creator request has completed."],["The `start_new_background_thread` function allows you to initiate a new background thread by specifying a target callable, arguments, and keyword arguments."],["The `BackgroundThread` class offers a `threading.Thread`-like interface for working with background threads."],["The module defines several exceptions, including `FrontendsNotSupported` and `BackgroundThreadLimitReachedError`, to handle specific errors related to background thread usage."]]],[]]