sentinel

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DEFAULT_TIMEOUT  = 0 //no timeout
	DEFAULT_INTERVAL = 100 * time.Millisecond
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Done

type Done func() bool

type Sentinel

type Sentinel struct {
	StatusFn   func() (doneFn Done, statusResp any, err error)
	OnCancelFn func() (onCancelFnResp any, err error)
	OnDoneFn   func(statusResp any) (onDoneFnResp any, err error)
	// contains filtered or unexported fields
}

func (Sentinel) Watch

func (s Sentinel) Watch(ctx context.Context, interval, timeout time.Duration) (WatchStatus, any, error)

Wait takes care of checking the status of something on a given interval, up to a timeout. The StatusFn check will continue until given Done function returns true or statusFn returns an error. Context cancellation is supported and in that case it will return WaitCanceled status.

type WatchStatus

type WatchStatus int
const (
	WatchSuccess WatchStatus = iota
	WatchErr
	WatchExecuting
	WatchTimeout
	WatchCanceled
)

func (WatchStatus) String

func (s WatchStatus) String() string

Jump to

Keyboard shortcuts

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