2 releases

0.1.1 Sep 27, 2024
0.1.0 Jun 26, 2024

#5 in #decentralized-applications

Download history 32/week @ 2024-06-20 140/week @ 2024-06-27 3/week @ 2024-07-04 7/week @ 2024-07-25 9/week @ 2024-09-12 13/week @ 2024-09-19 160/week @ 2024-09-26 21/week @ 2024-10-03

203 downloads per month
Used in 3 crates

Apache-2.0

2.5MB
69K SLoC

Agent Model and Lifecycle Definition API

This crate provides a framework for building agent implementations that are executed by the SwimOS runtime. Typically, the proc macros defined in the swimos_agent_derive crate will be used to generate agent specifications and agent lifecycles.

An agent specification defines the structure of the agent in terms of lanes and stores. A specification is sufficient, on its own, to define an agent route for the runtime. However, it will have only state with no associated behaviour.

An agent lifecycle is tied to a specific type of agent (any implementation of agent_model::AgentSpec). It adds behaviour to the agent by attaching event handlers to various lifecycle events defined for the agent and its lanes and stores. As the agent is executed by the runtime, each time one of these events is encountered, the appropriate event handler will be selected by the lifecycle and then executed.

Multiple lifecycle implementations maybe defined for the same agent specification, allowing the same structure to be used with different behaviour on separate agent routes.

Dependencies

~9–16MB
~198K SLoC