poll

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MPL-2.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 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