Heylisten is an event-dispatcher for Closures, Structs, Enums and other types. On another note, heylisten supports prioritised/ordered dispatching and aims to add parallel dispatching as well!
Everyone is welcome to contribute, check out the CONTRIBUTING.md
for further guidance.
Here is a quick example on how to use the event-dispatcher:
```rust extern crate heylisten; extern crate parkinglot;
use heylisten::Listener; use heylisten::EventDispatcher; use std::sync::Arc; use parking_lot::Mutex;
enum EventEnum { EventVariant, }
struct ListenerStruct {}
impl Listener
fn main() {
let listener = Arc::new(Mutex::new(ListenerStruct {}));
let mut dispatcher: EventDispatcher
dispatcher.add_listener(EventEnum::EventVariant, &listener);
} ```
Add this to your Cargo.toml
:
toml
[dependencies]
hey_listen = "0.1.2"
parking_lot = "^0.5"
and this to your crate's root:
rust,ignore
extern crate hey_listen;
extern crate parking_lot;