future

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Future

type Future[T any] interface {
	Get(ctx context.Context) (T, error)
	Done() <-chan struct{}
	IsDone() bool
}

func All added in v0.9.2

func All[T any](ctx context.Context, futures ...Future[T]) Future[[]T]

func Error added in v0.9.2

func Error[T any](err error) Future[T]

func First added in v0.9.2

func First[T any](ctx context.Context, first, second Future[T]) Future[T]

func Last added in v0.9.2

func Last[T any](ctx context.Context, first, second Future[T]) Future[T]

func Result added in v0.9.2

func Result[T any](result T, err error) Future[T]

func Task

func Task[T any](ctx context.Context, task func(ctx context.Context) (T, error)) Future[T]

func Value added in v0.9.2

func Value[T any](value T) Future[T]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL