Expand description
generational supports synchronizing the “generation” of data from a producer to multiple consumers.
The producer should own a Source that is in charge of notifying when the generation is incremented.
The consumers should have their own Waiters referencing this Source allowing them to wait for an update to the
generation.
See the tests module for an example.
Structs§
- Missed
Update 🔒 - Indicates that the
Sourcehas had multiple generation updates since the last timeWaiter::update_generationwas called, depending on the usecase this may mean some data values were missed. - Source
- Tracks the current generation, waking tasks that are
awaiting associatedWaiters when it increments. - Waiter 🔒
- Tracks the last seen generation of a
Source, whenawaited will resolve once the source is at a newer generation.