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 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
Click to show internal directories.
Click to hide internal directories.