On this page
WorkerRegistry tracks connected workers in memory and enforces one worker per project root, providing cross-process write safety by assignment; raises WorkerConflictError on a competing registration.
#worker.src.orxtra.worker._registry
#worker.src.orxtra.worker._registry
Worker registry: tracks connected workers and enforces one-per-root.
Each worker registers with a project root. Only one worker may be registered per root at a time. This constraint provides cross-process write safety by assignment -- workers run their own WriteQueue and StaleWriteTracker locally, and the one-worker-per-root rule prevents conflicting writes without distributed locking.
#WorkerConflictError
Raised when a second worker tries to register for the same root.
#WorkerInfo
State for a single connected worker.
#WorkerRegistry
In-memory registry of connected workers.
Enforces the one-worker-per-root constraint and provides lookup by worker ID or project root.
#register
def register(self, consumer_id: UUID | None, root: str, capabilities: list[ToolCapability], bridge: BrainWorkerBridge) -> UUIDRegister a new worker. Returns the assigned worker ID.
Raises WorkerConflictError if a worker is already registered for the given root.
#unregister
def unregister(self, worker_id: UUID) -> NoneRemove a worker from the registry.
#get_worker
def get_worker(self, worker_id: UUID) -> WorkerInfo | NoneLook up a worker by ID.
#get_worker_for_root
def get_worker_for_root(self, root: str) -> WorkerInfo | NoneLook up the worker registered for a project root.
#assign_task
def assign_task(self, worker_id: UUID, task_id: UUID) -> NoneRecord that a task is assigned to a worker.
#unassign_task
def unassign_task(self, worker_id: UUID, task_id: UUID) -> NoneRemove a task assignment from a worker.
#worker_count
def worker_count(self) -> int#list_workers
def list_workers(self) -> list[WorkerInfo]