Crates.io | epicenter |
lib.rs | epicenter |
version | 0.1.0 |
source | src |
created_at | 2023-12-19 09:50:01.57102 |
updated_at | 2023-12-20 02:57:13.713202 |
description | Simple synchronous and asynchronous event dispatcher for Rust |
homepage | |
repository | https://github.com/m1guelpf/epicenter |
max_upload_size | |
id | 1074140 |
size | 11,850 |
Simple sync/async event dispatcher for Rust
use epicenter::{Event, AsyncDispatcher};
#[derive(Debug, Clone)]
struct ExampleEvent {}
impl Event for ExampleEvent {}
let mut dispatcher = AsyncDispatcher::new();
dispatcher.listen(|event: ExampleEvent| async move {
// ...
}).await;
dispatcher.dispatch(&ExampleEvent {}).await?;
Refer to the documentation on docs.rs for detailed usage instructions.
This project is licensed under the MIT License - see the LICENSE file for details.