Documentation
¶
Overview ¶
Package operation polls Control Plane operations until they reach a terminal state. It is the `--wait` primitive for every mutation command.
Index ¶
Constants ¶
const (
DefaultTimeout = 10 * time.Minute
)
Variables ¶
This section is empty.
Functions ¶
func IsTerminal ¶
IsTerminal reports whether a canonical operation status will never change.
func Wait ¶
func Wait(ctx context.Context, poller Poller, initial client.OperationEnvelope, options Options) (client.OperationEnvelope, error)
Wait polls the operation until it is terminal, the timeout elapses, or the context is cancelled. The returned envelope is always the last document the caller can render, even when err is non-nil. Wait never cancels remotely.
Types ¶
type Options ¶
type Options struct {
Timeout time.Duration
Interval time.Duration
MaxInterval time.Duration
Now func() time.Time
Sleep func(context.Context, time.Duration) error
// Jitter bounds the random spread added to a computed delay. Nil uses
// up to 25 percent of the delay; tests inject a deterministic function.
Jitter func(time.Duration) time.Duration
// Progress is called after every poll that returned an operation.
Progress func(client.Operation)
}