The type of value being waited for
Creates a new WaitingForValue instance.
The type of value being waited for
Configuration options
Initializes or reinitializes the WaitingForValue with an optional preset value. If a preset value is provided and is Some, the value is immediately available. Otherwise, sets up the waiting mechanism for future value resolution.
Sets the value and resolves all pending waiters. If called when no value exists, resolves the waiting Future. If called when a value already exists, updates the value and resets the waiting mechanism. Does nothing if the provided value is None.
Returns a promise that resolves when the value becomes available. If the value is already set, returns a promise that resolves immediately. Multiple calls to this method are safe and efficient - all callers share the same resolution logic thanks to ResolveOnce.
A promise that resolves to the value
A utility for managing a value that may not be immediately available. Allows multiple callers to await the same value efficiently, with all waiters resolved when the value becomes available.
Example