Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Background Thread API Reference

The Backend API is deprecated as of March 13, 2014. Although Google will continue to support the Backend API in accordance with our terms of service , it is strongly recommended that all new applications use the Modules API instead.
The google.appengine.api.background_thread module defines functions and classes for working with background threads , threads which can "outlive" the request that spawned them.

Function

background_thread.start_new_background_thread ( target , args , kwargs =None)

Creates and starts a background thread. Returns the thread's id.

Arguments

target
Callable object to run in new thread
args
List of positional arguments passed to target
kwargs
Dictionary of keyword arguments passed to target

BackgroundThread class

A BackgroundThread is like a threading.Thread but can "outlive" the request that spawns it.

Constructor

class background_thread.BackgroundThread ( group =None, target =None, name =None, args =None, kwargs =None, verbose =None)
This constructor should always be called with keyword arguments.

Arguments

group
Should be None ; reserved for a future extension when a Python ThreadGroup class is implemented.
target
Callable object that will run in the background thread.
name
Thread name.
args
List of positional arguments passed to target
kwargs
Dictionary of keyword arguments passed to target

Instance Methods

start ()
Start the thread. Call this at most once per thread.
run ()
Method representing the thread's activity; a subclass can override this to do something else instead of calling target .
join ( timeout =None)
Wait until the thread terminates. The optional floating point timeout argument specifies a maxium number of seconds to wait.
is_alive ()
isAlive ()
Returns a Boolean indicating whether the thread is alive.
is_daemon ()
isDaemon ()
Returns a Boolean indicating whether the thread is a daemon thread.


Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.