worker_ready_decorator
Decorator for marking methods as worker-ready handlers.
- pipecat.pipeline.worker_ready_decorator.worker_ready(*, name: str)[source]
Mark a method as a handler for a specific worker becoming ready.
Decorated methods are automatically collected by BaseWorker at initialization. When the worker starts, it calls watch_workers for the decorated handlers. When a watched worker registers, the decorated method is called with the ready data.
Example:
@worker_ready(name="greeter") async def on_greeter_ready(self, data: WorkerReadyData) -> None: await self.activate_worker("greeter", args=...)
- Parameters:
name – The name of the worker to watch.