magpie.task.monitor¶
Module Contents¶
Classes¶
Events monitoring thread that captures events from the Celery worker cluster and acts upon those, in particular this will call the registered callbacks to be executed on tasks completion. |
Functions¶
Start a monitoring thread that will inspect the celery workers and notify back the app when tasks have finished processing, along with their results. |
|
Blocking wait for tasks to complete. |
|
Stop the task monitoring thread. |
Data¶
Dict of tasks that have been submitted with a callback to be executed with the result when the corresponding task finishes. |
|
|
|
Global monitoring thread object. |
API¶
- magpie.task.monitor.pending_tasks¶
None
Dict of tasks that have been submitted with a callback to be executed with the result when the corresponding task finishes.
- magpie.task.monitor.all_tasks_complete¶
‘Event(…)’
threading.Eventthat signals when all tasks have been completed.
- magpie.task.monitor.monitoring_thread¶
None
Global monitoring thread object.
- magpie.task.monitor.start_task_monitoring_thread()[source]¶
Start a monitoring thread that will inspect the celery workers and notify back the app when tasks have finished processing, along with their results.
- magpie.task.monitor.wait_for_tasks_completion(timeout=None)[source]¶
Blocking wait for tasks to complete.
- class magpie.task.monitor.EventsMonitor[source]¶
Bases:
threading.ThreadEvents monitoring thread that captures events from the Celery worker cluster and acts upon those, in particular this will call the registered callbacks to be executed on tasks completion.
Initialization
This constructor should always be called with keyword arguments. Arguments are:
group should be None; reserved for future extension when a ThreadGroup class is implemented.
target is the callable object to be invoked by the run() method. Defaults to None, meaning nothing is called.
name is the thread name. By default, a unique name is constructed of the form “Thread-N” where N is a small decimal number.
args is a list or tuple of arguments for the target invocation. Defaults to ().
kwargs is a dictionary of keyword arguments for the target invocation. Defaults to {}.
If a subclass overrides the constructor, it must make sure to invoke the base class constructor (Thread.init()) before doing anything else to the thread.