lunatic_runtime/
lib.rs

1/*!
2The [lunatic vm](https://lunatic.solutions/) is a system for creating actors from WebAssembly
3modules. This `lunatic-runtime` library allows you to embed the `lunatic vm` inside your Rust
4code.
5
6> _The actor model in computer science is a mathematical model of concurrent computation that
7treats actor as the universal primitive of concurrent computation. In response to a message it
8receives, an actor can: make local decisions, create more actors, send more messages, and
9determine how to respond to the next message received. Actors may modify their own private
10state, but can only affect each other indirectly through messaging (removing the need for
11lock-based synchronization)._
12>
13> Source: <https://en.wikipedia.org/wiki/Actor_model>
14
15_**Note:** If you are looking to build actors in Rust and compile them to `lunatic` compatible
16Wasm modules, checkout out the [lunatic crate](https://crates.io/crates/lunatic)_.
17
18## Core Concepts
19
20* [`Environment`] - defines the characteristics of Processes that are spawned into it. An
21  [`Environment`] is created with an [`EnvConfig`] to tweak various settings, like maximum
22  memory and compute usage.
23
24* [`WasmProcess`](process::WasmProcess) - a handle to send signals and messages to spawned
25  Wasm processes. It implements the [`Process`](process::Process) trait.
26
27
28## WebAssembly module requirements
29
30TODO
31*/
32
33mod config;
34pub mod state;
35
36pub use config::DefaultProcessConfig;
37pub use lunatic_process::{Finished, Process, Signal, WasmProcess};
38pub use state::DefaultProcessState;