lenskit.parallel.AccelTask#
- class lenskit.parallel.AccelTask[R]#
Bases:
ProtocolAn accelerated task, implemented by the accelerator backend.
This protocol is implemented by long-running accelerator tasks, and is used by
run_accel_task()to run these tasks with cancellation, progress reporting, and suitable thread pool management.The runner will spawn a background thread and call the task’s
invoke()method in that thread. The main thread will poll for completion and progress reports.- invoke()#
Run this task and return its result. Must only be called once for a given accelerator task. Will be run on the offloaded execution thread.
- Return type:
R