Documentation | Crate informations | Repository |
An actor model implementation for Rust.
```rust
use bottle::{Output, Receiver, Remote, Handler, EventQueue};
pub struct Foo { // }
pub enum Event {
Ping(Remote
impl bottle::Event for Event { type Response = (); }
impl Handler
async fn main() { let queue = EventQueue::new();
let a = Remote::new(queue.reference(), Foo { });
let b = Remote::new(queue.reference(), Foo { });
std::thread::spawn(move || {
async_std::task::block_on(queue.process())
});
a.send(Event::Ping(b)).await;
} ```
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.