iblqt.core.Worker
- class iblqt.core.Worker[source]
Bases:
QRunnable
A generic worker class for executing functions concurrently in a separate thread.
This class is designed to run functions concurrently in a separate thread and emit signals to communicate the results or errors back to the main thread.
Adapted from: https://www.pythonguis.com/tutorials/multithreading-pyqt-applications-qthreadpool/
- Variables:
fn (
Callable
) – The function to be executed concurrently.args (
tuple
) – Positional arguments for the function.kwargs (
dict
) – Keyword arguments for the function.signals (
WorkerSignals
) – An instance of WorkerSignals used to emit signals.
- run() None [source]
The main entry point for running the worker. Executes the provided function and emits signals accordingly.
- Return type:
None