future

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wait1 added in v0.6.1

func Wait1[T any](f1 Future[T], callback func(T))

func Wait1Ctx added in v0.9.0

func Wait1Ctx[T any](ctx context.Context, f1 Future[T], callback func(T), errCallback func(error))

func Wait2 added in v0.6.0

func Wait2[T, U any](f1 Future[T], f2 Future[U], callback func(T, U))

func Wait2Ctx added in v0.9.0

func Wait2Ctx[T, U any](ctx context.Context, f1 Future[T], f2 Future[U], callback func(T, U), errCallback func(error))

func Wait3 added in v0.6.0

func Wait3[T, U, V any](f1 Future[T], f2 Future[U], f3 Future[V], callback func(T, U, V))

func Wait3Ctx added in v0.9.0

func Wait3Ctx[T, U, V any](ctx context.Context, f1 Future[T], f2 Future[U], f3 Future[V], callback func(T, U, V), errCallback func(error))

func Wait4 added in v0.6.0

func Wait4[T, U, V, W any](f1 Future[T], f2 Future[U], f3 Future[V], f4 Future[W], callback func(T, U, V, W))

func Wait4Ctx added in v0.9.0

func Wait4Ctx[T, U, V, W any](ctx context.Context, f1 Future[T], f2 Future[U], f3 Future[V], f4 Future[W], callback func(T, U, V, W), errCallback func(error))

func Wait5 added in v0.6.0

func Wait5[T, U, V, W, X any](f1 Future[T], f2 Future[U], f3 Future[V], f4 Future[W], f5 Future[X], callback func(T, U, V, W, X))

func Wait5Ctx added in v0.9.0

func Wait5Ctx[T, U, V, W, X any](ctx context.Context, f1 Future[T], f2 Future[U], f3 Future[V], f4 Future[W], f5 Future[X], callback func(T, U, V, W, X), errCallback func(error))

func Wait6 added in v0.6.0

func Wait6[T, U, V, W, X, Y any](f1 Future[T], f2 Future[U], f3 Future[V], f4 Future[W], f5 Future[X], f6 Future[Y], callback func(T, U, V, W, X, Y))

func Wait6Ctx added in v0.9.0

func Wait6Ctx[T, U, V, W, X, Y any](ctx context.Context, f1 Future[T], f2 Future[U], f3 Future[V], f4 Future[W], f5 Future[X], f6 Future[Y], callback func(T, U, V, W, X, Y), errCallback func(error))

func Wait7 added in v0.6.0

func Wait7[T, U, V, W, X, Y, Z any](f1 Future[T], f2 Future[U], f3 Future[V], f4 Future[W], f5 Future[X], f6 Future[Y], f7 Future[Z], callback func(T, U, V, W, X, Y, Z))

Types

type Future

type Future[T any] interface {
	Get() T
	Set(T)
	IsSet() bool
	C() <-chan T
	GetContext(context.Context) (T, error)
}

func Instant

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

func New

func New[T any]() Future[T]

func NewFromChannel

func NewFromChannel[T any](ch <-chan T) Future[T]

Jump to

Keyboard shortcuts

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