poll

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWaitTimeout = errors.New("async result wait timeout")

Functions

func ExponentialBackoffLoop

func ExponentialBackoffLoop(ctx context.Context, timeout, baseInterval, maxInterval time.Duration, condition func() bool) error

ExponentialBackoffLoop sleeps in exponentially-backed-off intervals, calling condition each tick. It returns nil as soon as condition reports true, or an error once timeout expires. The first sleep happens before the first condition check, matching the behaviour of the original status polling loops.

func WaitForAsyncJob

func WaitForAsyncJob(ctx context.Context, resultPath string, port int, timeout time.Duration, opName string) (*client.CommandResponse, error)

func WaitForFile

func WaitForFile(ctx context.Context, resultPath string, port int, timeout time.Duration, opName string) (*client.CommandResponse, error)

WaitForFile polls a filesystem result file until it appears, Unity stops, or the timeout expires. It uses exponential backoff starting at 100 ms and capping at 1.5 s to avoid burning I/O on long-running operations.

Types

This section is empty.

Jump to

Keyboard shortcuts

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