future

package
v0.1.79 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: Apache-2.0 Imports: 2 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 for the future to resolve. Returns the context cause if it's canceled.
	Wait(ctx context.Context) (T, error)

	// Sync checks the future's result immediately, returning false if not yet available.
	Sync() (T, error, bool)
}

Future represents some future result.

func New added in v0.1.16

func New[T any]() (Future[T], func(result T, err error))

New creates a new resolvable future.

Jump to

Keyboard shortcuts

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