future

package module
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 1 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 {
	Wait() (T, error)
}

func Go

func Go[T any](fn GoFunc[T]) Future[T]

func Then

func Then[T1 any, T2 any](f Future[T1], thenFunc ThenFunc[T1, T2]) Future[T2]

type GoFunc

type GoFunc[T any] func() (T, error)

type ThenFunc

type ThenFunc[T1 any, T2 any] func(T1) (T2, error)

type Value

type Value[T any] interface {
	Future[T]
	Resolve(T, error)
}

func NewValue

func NewValue[T any]() Value[T]

type Waiter

type Waiter interface {
	Wait()
	Done()
}

func NewWaiter

func NewWaiter() Waiter

Jump to

Keyboard shortcuts

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