Crate async_atomic

Source
Expand description

Atomics which can be subscribed to and asynchronously notify when updated.

The main structure is AsyncAtomic that behaves like stdlib’s atomics, but don’t take an explicit Ordering for simplicity.

A reference to AsyncAtomic can asynchronously wait for updates using methods from AsyncAtomicRef trait.

Note that if there are more than one future at the same time then only the most recently polled future will be notified. Older futures will never receive an update, so it’s up to user to ensure that only one of them .awaiting at a time.

Modules§

prelude

Structs§

AsyncAtomic
Atomic value that also contains Waker to notify subscriber asynchronously.
Changed
Stream that yields value when it change.
Wait
Future to wait for specific value.
WaitAndUpdate
Future to wait and update an atomic value.

Traits§

AsyncAtomicRef
Generic reference to async atomic.
Atom
Types that can be represented by a primitive type supporting atomic operations.