Promise

public final class Promise<Output> : FutureProtocol

An one-shot slot that can be used to communicate a value between tasks.

Promise is safe to use between any number of tasks that are racing to provide the value and a single task that is polling for it.

Promise is only able to communicate a single value. If you need to efficiently communicate a sequence of asynchronously produced values, see Channel.Unbuffered.