Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Promise ¶
type Promise[T any] interface { // Await blocks until the value is resolved or rejected. Await(context.Context) (T, error) }
A promise for a future value.
type Resolver ¶
type Resolver[T any] interface { // Resolve a promise. Unblocks all Await()s. Future calls of Await() // return the resolved value immediately. // // Only the first call to resolve (or reject) has an effect and // further calls are ignored. Resolve(T) // Reject a promise with an error. Reject(error) }
Resolver can resolve or reject a promise. These methods are separate from 'Promise' to make it clear where the promise is resolved from.
Click to show internal directories.
Click to hide internal directories.