future

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FutureErr

type FutureErr[T any] struct {
	// contains filtered or unexported fields
}

FutureErr is a future which resolves to a value or an error.

func NewFutureErr

func NewFutureErr[T any]() (*FutureErr[T], func(T, error))

NewFutureErr creates a new future which resolves to a T or an error.

Returns the future, and a function which is used to set the future's value/error. Calls to the future's Get function will block until this function is called.

func (*FutureErr[T]) Get

func (f *FutureErr[T]) Get() (T, error)

Get resolves the future, returning either a valid T or an error.

This function will block until the future has had its value set.

Jump to

Keyboard shortcuts

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