Module pasts::notify

source ·
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

Traits

  • Trait for “fusing” a Future (conversion to a Notify)
  • Trait for asynchronous event notification
  • An extension trait for Notifys that provides a variety of convenient adapters.

Functions

Type Definitions