poll

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExponentialBackoffLoop

func ExponentialBackoffLoop(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(resultPath string, port int, timeout time.Duration, opName string) (*client.CommandResponse, error)

WaitForAsyncJob wraps WaitForFile with log suppression for the known-harmless "Unsolicited response received on idle HTTP channel" noise that Go's net/http emits when Unity drops the connection during a domain reload.

func WaitForFile

func WaitForFile(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