napari.qt.threading.FunctionWorker#

class napari.qt.threading.FunctionWorker(func: Callable[[_P], _R], *args, **kwargs)[source]#

Bases: FunctionWorker[_R], _NotifyingMixin

Methods

autoDelete(self)

await_workers([msecs])

Ask all workers to quit, and wait up to msec for quit.

create(functionToRun)

quit()

Send a request to abort the worker.

run()

Start the worker.

setAutoDelete(self, _autoDelete)

start()

Start this worker in a thread and add it to the global threadpool.

work()

Main method to execute the worker.

Attributes

abort_requested

Whether the worker has been requested to stop.

is_running

Whether the worker has been started.

Details

property abort_requested: bool#

Whether the worker has been requested to stop.

autoDelete(self) bool#
classmethod await_workers(msecs: int | None = None) None#

Ask all workers to quit, and wait up to msec for quit.

create(functionToRun: Callable[[], None]) QRunnable | None#
property is_running: bool#

Whether the worker has been started.

quit() None#

Send a request to abort the worker.

run() None#

Start the worker.

setAutoDelete(self, _autoDelete: bool)#
start() None#

Start this worker in a thread and add it to the global threadpool.

work() _R[source]#

Main method to execute the worker.