python.task_manager.results_poller module¶
Results dispatcher for the background task manager.
-
class
ResultsDispatcher
(parent=None)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Dispatches events synchronously to the thread that owns this object.
Signalling between two different threads in PySide is broken in several versions of PySide. There are very subtle race conditions that arise when there is a lot of signalling between two threads. Some of these things have been fixed in later versions of PySide, but most hosts integrate PySide 1.2.2 and lower, which are victim of this race condition.
The background task manager does a lot on inter-threads communications and therefore can easily fall pray to these deadlocks that exist within PySide.
Therefore, we instead use Qt’s QMetaObject invokeMethod to carry information to the background task manager thread in a thread-safe manner, since it doesn’t exhibit the bad behaviour from PySide’s signals.
-
emit_completed
(worker_thread, task, result)[source]¶ Called by background threads to notify that a task has completed.
Parameters: - worker_thread – Worker thread that completed sucessfully.
- task – Task id of the completed task.
- result – Result published by the ta
-
emit_failure
(worker_thread, task, msg, traceback)[source]¶ Called by background threads to notify that a task has completed.
Parameters: - worker_thread – Worker thread that completed sucessfully.
- task – Task id of the completed task.
- msg – Error message from the worker thread.
- traceback – Traceback from the worker thread error.
-
task_completed
¶ Used by autodoc_mock_imports.
-
task_failed
¶ Used by autodoc_mock_imports.
-