future

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: GPL-3.0 Imports: 4 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 struct {
	// contains filtered or unexported fields
}

The Future object implements a container for (value, error) pair that "will be populated later" and allows multiple users to wait for it to be set.

It should not be copied after first use.

func New

func New() *Future

func (*Future) Get

func (f *Future) Get() (interface{}, error)

func (*Future) GetContext

func (f *Future) GetContext(ctx context.Context) (interface{}, error)

func (*Future) Set

func (f *Future) Set(val interface{}, err error)

Set sets the Future (value, error) pair. All currently blocked and future Get calls will return it.

Jump to

Keyboard shortcuts

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