Expand description
Asynchronous event notifys
A Notify
is kind of like a cross between a Future
and an
AsyncIterator
. Like streams, they may
return more than one value, and are expected to not panic after polling.
Like futures, they produce non-optional values. In a sense they are an
infinite stream. In another sense, they are a repeating future.
Why Another Abstraction?
Notifys allow for some nice ergonomics and guarantees when working with
event-loop based asynchronous code, which could lead to some
simplifications. Unlike futures and streams, they do not need to be fused,
and if your stream is infinite, you won’t need to sprinkle unwrap()
s in
your code at each call to .next()
. They also lend themselves nicely for
creating clean and simple multimedia APIs.
Structs
- The
Notify
returned fromNotifyExt::map()
- The
Future
returned fromNotifyExt::next()
- A
Notify
that never produces an event. - A
Notify
that immediately produces a single event.
Traits
- Trait for asynchronous event notification
- An extension trait for
Notify
s that provides a variety of convenient adapters.
Functions
- Create a
Notify
which never becomes ready with an event. - Create a
Notify
which is immediately ready with an event.
Type Definitions
- An owned dynamically typed
Notify
for use in cases where you can’t statically type your result or need to add some indirection.