The ceilometer.openstack.common.threadgroup
ModuleΒΆ
-
class
ceilometer.openstack.common.threadgroup.
Thread
(thread, group)[source] Bases:
object
Wrapper around a greenthread, that holds a reference to the
ThreadGroup
. The Thread will notify theThreadGroup
when it has done so it can be removed from the threads list.-
link
(func, *args, **kwargs)[source]
-
stop
()[source]
-
wait
()[source]
-
-
class
ceilometer.openstack.common.threadgroup.
ThreadGroup
(thread_pool_size=10)[source] Bases:
object
The point of the ThreadGroup class is to:
- keep track of timers and greenthreads (making it easier to stop them when need be).
- provide an easy API to add timers.
-
add_dynamic_timer
(callback, initial_delay=None, periodic_interval_max=None, *args, **kwargs)[source]
-
add_thread
(callback, *args, **kwargs)[source]
-
add_timer
(interval, callback, initial_delay=None, *args, **kwargs)[source]
-
stop
(graceful=False)[source] stop function has the option of graceful=True/False.
- In case of graceful=True, wait for all threads to be finished. Never kill threads.
- In case of graceful=False, kill threads immediately.
-
stop_timers
()[source]
-
thread_done
(thread)[source]
-
wait
()[source]