Promise

Represents an asynchronously computed value.

Promise.swift:13
final class Promise<T, E> where T : Sendable, E : Error

Promises are executed immediately, i.e. is body runs synchronously with the constructor, similar to e.g. JavaScript’s promises, but different from Python/Rust.

Sendable safety: Promises are sendable because they guard their internal state with a mutex.