Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Poll ¶
Poll calls fetch repeatedly until it returns done or an error. It calls fetch immediately on the first iteration (no initial wait).
func WithOnProgress ¶ added in v0.6.0
func WithOnProgress(ctx context.Context, fn OnProgress) context.Context
WithOnProgress attaches a progress callback to the context. When Poll is called without Config.OnProgress, it falls back to this.
Types ¶
type Config ¶
type Config struct {
Interval time.Duration // base polling interval
MaxAttempts int // 0 means unlimited
Backoff float64 // multiplier per attempt; 1.0 = fixed interval
MaxInterval time.Duration // upper bound for backoff growth
OnProgress OnProgress // optional progress callback
}
Config controls polling behavior.
type Fetcher ¶
Fetcher checks whether an async task has completed. It returns the result string when done is true.
type OnProgress ¶
OnProgress is called after each poll attempt (optional).
Click to show internal directories.
Click to hide internal directories.