Versions in this module Expand all Collapse all v0 v0.0.2 Mar 7, 2024 Changes in this version + func AwaitAllAny(ctx context.Context, futures ...AnyFuture) func(yield func(int, result.Result[any]) bool) + func AwaitAllResultsAny(ctx context.Context, futures ...AnyFuture) []result.Result[any] + func AwaitAllResults[R any](ctx context.Context, futures ...Future[R]) []result.Result[R] + func AwaitAllValuesAny(ctx context.Context, futures ...AnyFuture) ([]any, error) + func AwaitAllValues[R any](ctx context.Context, futures ...Future[R]) ([]R, error) + func AwaitAll[R any](ctx context.Context, futures ...Future[R]) func(yield func(int, result.Result[R]) bool) + func AwaitFirstAny(ctx context.Context, futures ...AnyFuture) (any, error) + func AwaitFirst[R any](ctx context.Context, futures ...Future[R]) (R, error) + type AnyFuture interface v0.0.1 Feb 27, 2024 Changes in this version + var ErrNoResult = errors.New("no result") + var ErrNotReady = errors.New("future not ready") + func New[R any]() (Promise[R], Future[R]) + type Future <-chan result.Result[R] + func NewAsync[R any](fn func() (R, error)) Future[R] + func (f Future[R]) Await(ctx context.Context) (R, error) + func (f Future[R]) Memoize() *Memoizer[R] + func (f Future[R]) Try() (R, error) + type List []Future[R] + func (l List[R]) All(ctx context.Context) func(yield func(int, result.Result[R]) bool) + func (l List[R]) AwaitAll(ctx context.Context) []result.Result[R] + func (l List[R]) AwaitAllValues(ctx context.Context) ([]R, error) + func (l List[R]) AwaitFirst(ctx context.Context) (R, error) + type Memoizer struct + func (m *Memoizer[R]) Await(ctx context.Context) (R, error) + func (m *Memoizer[R]) Try() (R, error) + type Promise chan<- result.Result[R] + func (p Promise[R]) Do(f func() (R, error)) + func (p Promise[R]) Reject(err error) + func (p Promise[R]) Resolve(value R)