simple_event_map
simple_event_stream
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
// this returns an `EventStream`
// which can be used as a blocking Iterator or as an async Stream
let mut m1 = map.;
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!;
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: 0BSD