wait

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func New

func New(f WaitFn) *Handler

New creates a new Wait instance

func (*Handler) SetThrottle

func (w *Handler) SetThrottle(d time.Duration) error

SetThrottle sets the duration between func triggering

func (*Handler) SetTimeout

func (w *Handler) SetTimeout(d time.Duration) *Handler

SetTimeout sets the duration for wait timeout

func (*Handler) Wait

func (w *Handler) Wait() (res interface{}, err error)

Wait starts the wait until there's an error or wait is done

func (Handler) WaitWithContext added in v1.8.0

func (w Handler) WaitWithContext(ctx context.Context) (res interface{}, err error)

WaitWithContext starts the wait until there's an error or wait is done

type WaitFn

type WaitFn func() (res interface{}, done bool, err error)

Jump to

Keyboard shortcuts

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