Ir para o conteúdo

Overview

package wittgenstein_distributed_executor

Wittgenstein Distributed Executor Library.

Executes agent tasks concurrently in background queues.

Classes

  • Task — Pydantic model representing a task execution job payload.

  • TaskStatus

  • DistributedExecutor — Executes registered tasks concurrently in a thread pool executor.

wittgenstein_distributed_executor.Task

mkapi_definition_mkapi class Task()

Bases : BaseModel

Pydantic model representing a task execution job payload.

wittgenstein_distributed_executor.TaskStatus

mkapi_definition_mkapi class TaskStatus()

Bases : str, Enum

wittgenstein_distributed_executor.DistributedExecutor

mkapi_definition_mkapi class DistributedExecutor(max_workers: int = 5)

Executes registered tasks concurrently in a thread pool executor.

Methods

wittgenstein_distributed_executor.DistributedExecutor.register_task

mkapi_definition_mkapi method DistributedExecutor.register_task(task: Task) → None

Register a new task in the queue.

wittgenstein_distributed_executor.DistributedExecutor.execute_task

mkapi_definition_mkapi 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.DistributedExecutor.execute_batch

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

Execute multiple tasks in parallel.