Function cdrs::events::new_listener
[−]
[src]
pub fn new_listener<X>(transport: X) -> (Listener<X>, EventStream)
Factory function which returns a Listener
and related EventStream.
Listener
provides only one function start
to start listening. It
blocks a thread so should be moved into a separate one to no release
main thread.
EventStream
is an iterator which returns new events once they come.
It is similar to Receiver::iter
.