Agent
Agent starts :pypi:cell actors.
Attributes
| Attribute | Type | Description |
|---|---|---|
| conditional | boolean = True | Flag indicating that the step is only started if the enabled condition is met. |
| requires | tuple = (Connection,) | List of other bootsteps that must be started before this agent can run. |
| agent_cls | class | The specific actor class to be instantiated, retrieved from the application configuration. |
| enabled | boolean | Determines if the agent bootstep should be executed based on the worker_agent configuration setting. |
Constructor
Signature
def Agent(
c: Any,
**kwargs: dict
)
Parameters
| Name | Type | Description |
|---|---|---|
| c | Any | The consumer or parent object context. |
| **kwargs | dict | Additional keyword arguments passed to the parent class constructor. |
Signature
def Agent(
c: celery.worker.Consumer,
**kwargs: dict
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| c | celery.worker.Consumer | The consumer instance this step belongs to |
| **kwargs | dict | Additional keyword arguments passed to the parent StartStopStep constructor |
Methods
create()
@classmethod
def create(
c: celery.worker.Consumer
) - > cell.Actor
Instantiates the agent class using the current connection and assigns it to the consumer.
Parameters
| Name | Type | Description |
|---|---|---|
| c | celery.worker.Consumer | The consumer instance providing the connection and storage for the created agent |
Returns
| Type | Description |
|---|---|
cell.Actor | The instantiated agent actor instance |