asyncutils

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitForStateTransition

func WaitForStateTransition(ctx context.Context, resourceType, resourceID string, stateChecker StateChecker, opts ...Option) error

WaitForStateTransition waits for a resource to reach the desired state by polling its current state. The default poll interval is two seconds; pass WithPollInterval to customize it.

Types

type Option added in v0.16.1

type Option func(*waitConfig)

Option customizes WaitForStateTransition behavior.

func WithPollInterval added in v0.16.1

func WithPollInterval(d time.Duration) Option

WithPollInterval overrides the default polling interval. Useful for long-running resources (e.g. connector sync jobs) where a slower cadence is more appropriate than the default snappy 2-second tick.

type StateChecker

type StateChecker func(ctx context.Context) (isDesiredState bool, err error)

StateChecker is a function that checks if a resource is in the desired state. It should return true if the resource is in the desired state, false otherwise, and any error that occurred during the check.

Jump to

Keyboard shortcuts

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