mantidimaging.gui.dialogs.async_task.task module

class mantidimaging.gui.dialogs.async_task.task.TaskWorkerThread(parent=None)[source]

Bases: QThread

Thread for running tasks asynchronously to the GUI.

Intended for internal use within this module only.

Usage:

t = TaskWorkerThread(parent) t.task_function = … t.finished.connect(…) t.start()

On completion inspect:

t.result t.error

error

alias of Optional[Exception]

run(self)[source]
task_function

alias of Optional[Callable]

was_successful() bool[source]

Inspects the result and error values of the async task.

For a task to be “successful” the result must have a value and the error must be None.

Returns:

True if task finished successfully