Entity Class
Durable Entity Class.
Responsible for executing the user-defined entity function.
Create a new entity for the user-defined entity.
Responsible for executing the user-defined entity function
Constructor
Entity(entity_func: Callable[[DurableEntityContext], None])
Parameters
Name | Description |
---|---|
entity_func
Required
|
The user defined entity function |
Methods
create |
Create an instance of the entity class. |
handle |
Handle the execution of the user-defined entity function. Loops over the batch, which serves to specify inputs to the entity, and collects results and generates a final state, which are returned. |
create
handle
Handle the execution of the user-defined entity function.
Loops over the batch, which serves to specify inputs to the entity, and collects results and generates a final state, which are returned.
handle(context: DurableEntityContext, batch: List[Dict[str, Any]]) -> str
Parameters
Name | Description |
---|---|
context
Required
|
The entity context of the entity, which the user interacts with as their Durable API |
batch
Required
|
|
Returns
Type | Description |
---|---|
A JSON-formatted string representing the output state, results, and exceptions for the entity execution. |