Skip to content
This repository has been archived by the owner on Jul 19, 2020. It is now read-only.

Add a diagram of the Agent lifecycle #23

Open
jstarry opened this issue Feb 9, 2020 · 2 comments
Open

Add a diagram of the Agent lifecycle #23

jstarry opened this issue Feb 9, 2020 · 2 comments

Comments

@jstarry
Copy link
Member

jstarry commented Feb 9, 2020

DOC TODO: https://yew.rs/docs/concepts/agents#lifecycle

Describe the lifecycle methods of an Agent and the lifetime of each type of Agent (Job, Context, Private, Public)

    /// Creates an instance of an agent.
    fn create(link: AgentLink<Self>) -> Self;

    /// This method called on every update message.
    fn update(&mut self, msg: Self::Message);

    /// This method called on when a new bridge created.
    fn connected(&mut self, _id: HandlerId) {}

    /// This method called on every incoming message.
    fn handle_input(&mut self, msg: Self::Input, id: HandlerId);

    /// This method called on when a new bridge destroyed.
    fn disconnected(&mut self, _id: HandlerId) {}

    /// This method called when the agent is destroyed.
    fn destroy(&mut self) {}
@teymour-aldridge
Copy link
Contributor

teymour-aldridge commented Apr 13, 2020

I'm not exactly sure where all the arrows should go, but would a diagram like this do the trick?
Diagram.
The diagram was made with nomnoml.com.

@jstarry
Copy link
Member Author

jstarry commented Apr 14, 2020

Thanks @teymour-aldridge this is a good start! It'd be great if this was added to the docs :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants