Help us shape the future of Go! Take the 2026 Go Developer Survey

poll

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimedOut = errors.New("timed out")

Functions

This section is empty.

Types

type Func

type Func[T any] func(ctx context.Context) (*T, error)

type Option

type Option[T any] func(*Pollable[T])

func WithLastResultTo

func WithLastResultTo[T any](resultTarget **T) Option[T]

type Pollable

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

Pollable is created with convenient factories such as AtMostFor.

func AtMostFor

func AtMostFor[T any](timeout time.Duration, f Func[T], options ...Option[T]) (pollable Pollable[T])

AtMostFor is a factory for Pollable and enables inference of T by compiler from given func return value *T. Optionally supports catching the last result with WithLastResultTo.

func (Pollable[T]) Until

func (pollable Pollable[T]) Until(ctx context.Context, until func(item *T) (done bool, err error)) error

Until retries Pollable.Func until the given predicate indicates done.

Jump to

Keyboard shortcuts

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