async-promise
A simple promise implementation that allows for a single producer to resolve a value to multiple consumers.
Similar to a oneshot channel, but allows for multiple consumers to wait for the value to be resolved, which will be
provided as a reference (&T
).
Similar to an async OnceCell
, but consumers may only await the value, and may not attempt to set it.
Use [channel()
] to create a new promise and resolver pair.
Usage
Add the following to your Cargo.toml
:
[]
= "..."
Basic usage:
async