mafw.steering_gui.threading.workers

Threading helpers for future steering GUI background tasks.

Author:

Bulgheroni Antonio (antonio.bulgheroni@ec.europa.eu)

Description:

Define a reusable worker QObject that can execute callables without blocking the UI.

Module Attributes

T

Type variable for the return type of the worker's callable.

Classes

Worker(fn, *args, **kwargs)

Run a callable in a thread pool while exposing progress, error, and completion signals.

WorkerSignals

Bundle of signals emitted by a worker.

class mafw.steering_gui.threading.workers.T

Type variable for the return type of the worker’s callable.

alias of TypeVar(‘T’)

class mafw.steering_gui.threading.workers.Worker(fn: Callable[[...], T], *args: Any, **kwargs: Any)[source]

Bases: QRunnable, Generic[T]

Run a callable in a thread pool while exposing progress, error, and completion signals.

connect(*, finished: Callable[[T], None] | None = None, error: Callable[[Exception], None] | None = None, progress: Callable[[int], None] | None = None) None[source]

Attach callbacks to the worker signals.

run() None[source]

Execute the callable and propagate its result or any exception.

class mafw.steering_gui.threading.workers.WorkerSignals[source]

Bases: QObject, Generic[T]

Bundle of signals emitted by a worker.