tokio-agent

Crates.iotokio-agent
lib.rstokio-agent
version0.1.0
sourcesrc
created_at2022-05-19 10:06:06.815428
updated_at2022-05-19 10:06:06.815428
descriptionAgents are a simple abstraction around state, inspired by Elixir's Agent.
homepagehttps://github.com/jhgg/tokio-agent
repositoryhttps://github.com/jhgg/tokio-agent
max_upload_size
id589627
size26,289
Jake (jhgg)

documentation

README

"Agents are a simple abstraction around state."

This crate is inspired by Elixir's Agent.

In Rust however, an Agent holds your State in either a tokio task, or a thread, and allows you to interact with that state, while having the state remain within the task or thread.

An agent managing state in a thread for examplue could be used to manage and interact with a resource which would cause blocking on the tokio runtime (for example, sqlite database).

An agent managing state in a task could be used to manage and interact with a resource in a lock-free way.

Commit count: 4

cargo fmt