Worker

class Worker(BaseNode, ABC):

A worker node that works on tasks. It is the basic unit of task processing in the workforce system.

Parameters:

  • description (str): Description of the node.
  • node_id (Optional[str]): ID of the node. If not provided, it will be generated automatically. (default: :obj:None)

init

def __init__(self, description: str, node_id: Optional[str] = None):

repr

def __repr__(self):

_get_dep_tasks_info

def _get_dep_tasks_info(dependencies: List[Task]):

set_channel

def set_channel(self, channel: TaskChannel):

stop

def stop(self):

Stop the worker.