Zum Inhalt

executor

module wittgenstein_distributed_executor.executor

Classes

wittgenstein_distributed_executor.executor.DistributedExecutor

class DistributedExecutor(max_workers: int = 5)

Executes registered tasks concurrently in a thread pool executor.

Methods

wittgenstein_distributed_executor.executor.DistributedExecutor.register_task

method DistributedExecutor.register_task(task: Task) → None

Register a new task in the queue.

wittgenstein_distributed_executor.executor.DistributedExecutor.execute_task

async method DistributedExecutor.execute_task(self, task_id: str, fn: Callable[..., Any], *args, **kwargs) → Task

Execute a single registered task in the thread pool.

Raises

  • ValueError

wittgenstein_distributed_executor.executor.DistributedExecutor.execute_batch

async method DistributedExecutor.execute_batch(self, task_fn_args: List[tuple[str, Callable[..., Any], list, dict]]) → List[Task]

Execute multiple tasks in parallel.