A one-to-many provider for a single value.
A BroadcastValueProvider can vend multiple ValueFuture objects. When the provider is resolved, all futures vended by it are completed with the same value.
This provider is multi-shot: after Resolve is called, new futures can be retrieved with Get to wait for the next Resolve event.
Public Member Functions | |
| ValueFuture< T > | Get () |
| template<typename U = T, std::enable_if_t<!std::is_void_v< U >, int > = 0> | |
| void | Resolve (const U &value) |
Resolves every pending ValueFuture with a copy of the provided value. | |
| template<typename U = T, std::enable_if_t< std::is_void_v< U >, int > = 0> | |
| void | Resolve () |
Resolves every pending ValueFuture. | |
|
inline |
Returns a ValueFuture that will be completed when Resolve is called.
Multiple futures can be retrieved and will pend concurrently.