future

package
v1.2.10-prerelease3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFuture

func NewFuture() (Future, Settable)

NewFuture creates a new Future and the Settable for setting its value

Types

type Future

type Future interface {
	Get(ctx context.Context, valuePtr interface{}) error
	IsReady() bool
}

Future represents a value that will be available in the future

type Settable

type Settable interface {
	Set(interface{}, error)
}

Settable is for setting value and error for the corresponding Future The Set method can only be called once. Later calls will result in a panic since the value and error has already been set.

Jump to

Keyboard shortcuts

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