future

package
v0.8.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 2 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 Wait2 added in v0.6.0

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

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 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 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 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 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