Expand description
Producer/consumer shared state with async waker-based notification.
This crate provides Producer and Consumer types that share state through
a mutex-protected value. Producers can modify the state and consumers are
automatically notified via async wakers. The channel auto-closes when all
producers are dropped.
For state that both sides legitimately mutate (e.g. a reverse request queue),
Shared is a role-less sibling: every handle can lock, read, or park on a
predicate, with no liveness of its own.
Structs§
- Closed
- The channel closed before the awaited condition held.
- Consumer
- The consuming side of a shared state channel.
- Consumer
Weak - A weak handle from the consuming side (
Consumer::weak). - Mut
- A mutable guard over the shared state.
- Pending
- Adapts a
Pollableinto aFuture, retaining the strongWaiterbetween polls so its weak registration stays live. - Producer
- The producing side of a shared state channel.
- Producer
Weak - A weak handle from the producing side (
Producer::weak). - Ref
- A read-only guard over the shared state.
- Shared
- A cloneable, lock-guarded value with waker notification.
- Waiter
- Handle passed to poll functions for registering with
WaiterLists. - Waiter
List - A list of weak wakers waiting for notification.
Traits§
- Pollable
- A pollable computation backed by kio channels.