Module generational

Module generational 

Source
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§

MissedUpdate 🔒
Indicates that the Source has had multiple generation updates since the last time Waiter::update_generation was called, depending on the usecase this may mean some data values were missed.
Source
Tracks the current generation, waking tasks that are awaiting associated Waiters when it increments.
Waiter 🔒
Tracks the last seen generation of a Source, when awaited will resolve once the source is at a newer generation.