poll

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package poll defines polling mechanisms.

Index

Constants

This section is empty.

Variables

View Source
var ErrAborted = errors.New("aborted")

Functions

This section is empty.

Types

type Poller

type Poller interface {
	// Polls until "check" function returns "done=true".
	// If "check" returns a non-empty error, it logs and
	// continues the polling until context is canceled.
	// It returns the duration that it took to complete the check.
	Poll(
		ctx context.Context,
		check func() (done bool, err error),
	) (time.Duration, error)
}

func New

func New(interval time.Duration) Poller

Jump to

Keyboard shortcuts

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