A discrete event simulator that let you specify application logic in asynchronous functions. The main goal of this crate is to make simulation code look very similar to that of a real-world system.. This is achieved by providing an API similar to that of the standard library or tokio but with an implementation based on discrete events.
This crate provides the simulator itself, a timer that allows an asynchronous task to sleep, and synchronization primitives. Additionally, it includes basic primitives to simulate networking (guarded behind the "network" feature).
network
: Enable networking primitivesserde
: Support serialization of (some) asim objects using serde
Take a look at the tests and examples to get an idea how this library is intended to be used.
Feel free to open an issue if some parts of this crate lack documentation.
This project is still in early development and many parts of the API are subject to change.
Pull requests for additional synchronization primitives or other functionality are very welcome.
The following crates that also implement event simulation exist. Both of them are more mature but do not use async Rust like this crate.
I am sure this list is incomplete. Please let me know of any other crates, and I will extend it.