simple_event_map
This allows you to register types that'll be broadcast to receivers
An example
let mut map = new;
// nothing is registered by default
assert_eq!;
assert_eq!;
assert_eq!;
// register two subscriptions for the message
// you can get a blocking iterator
let mut m1 = map.;
// or you can get an async stream
let mut m2 = map.;
let msg = Message;
// send the message, will return a bool if any messages were sent
assert_eq!;
// we should have 2 still active
assert_eq!;
assert_eq!;
// m2 is a stream, so we have to await it (and use StreamExt::next)
assert_eq!;
// drop a subscription (will be cleaned up in the eventmap on next send)
drop;
let msg = Message;
assert_eq!;
// we only have 1 active now
assert_eq!;
License
simple_event_map
is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE and LICENSE-MIT for details.