future

package
v1.23.0-rc14 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT 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 {
	Get(ctx context.Context) (T, error)
	Ready() bool
}

type FutureImpl

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

func NewFuture

func NewFuture[T any]() *FutureImpl[T]

func (*FutureImpl[T]) Get

func (f *FutureImpl[T]) Get(
	ctx context.Context,
) (T, error)

func (*FutureImpl[T]) Ready

func (f *FutureImpl[T]) Ready() bool

func (*FutureImpl[T]) Set

func (f *FutureImpl[T]) Set(
	value T,
	err error,
)

type ReadyFutureImpl

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

func NewReadyFuture

func NewReadyFuture[T any](
	value T,
	err error,
) *ReadyFutureImpl[T]

func (*ReadyFutureImpl[T]) Get

func (f *ReadyFutureImpl[T]) Get(
	_ context.Context,
) (T, error)

func (*ReadyFutureImpl[T]) Ready

func (f *ReadyFutureImpl[T]) Ready() bool

Jump to

Keyboard shortcuts

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