Package cherrypy :: Package process :: Module plugins :: Class BackgroundTask
[hide private]
[frames] | no frames]

Class BackgroundTask

source code

        object --+        
                 |        
threading._Verbose --+    
                     |    
      threading.Thread --+
                         |
                        BackgroundTask

A subclass of threading.Thread whose run() method repeats.

Use this class for most repeating tasks. It uses time.sleep() to wait for each interval, which isn't very responsive; that is, even if you call self.cancel(), you'll have to wait until the sleep() call finishes before the thread stops. To compensate, it defaults to being daemonic, which means it won't delay stopping the whole process.

Instance Methods [hide private]
 
__init__(self, interval, function, args=[], kwargs={}, bus=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
cancel(self) source code
 
run(self) source code
 
_set_daemon(self) source code

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, is_alive, join, setDaemon, setName, start

Inherited from threading.Thread (private): _reset_internal_locks, _set_ident

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from threading.Thread: daemon, ident, name

Inherited from threading.Thread (private): _block

Inherited from object: __class__

Method Details [hide private]

__init__(self, interval, function, args=[], kwargs={}, bus=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

run(self)

source code 
Overrides: threading.Thread.run

_set_daemon(self)

source code 
Overrides: threading.Thread._set_daemon