RetryConfig
Overview
RetryConfig configures Retry backoff.
Part of the async package — Node.js analog: Promise.all, timers.
RetryConfig is a type exported by gox. Methods on this type are documented separately.
Signature
go
type RetryConfig struct {
Attempts int
Initial time.Duration
Max time.Duration
Factor float64
}Compare: Node.js · Standard Go · gox
js
// Typical Promise.all, timers pattern in Node.jsgo
// Use the underlying stdlib or driver directly.
// See package overview for escape hatches.go
import "github.com/sahilkhaire/gox/async"
cfg := async.RetryConfig{MaxAttempts: 3, Delay: time.Second}Example
go
import "github.com/sahilkhaire/gox/async"
cfg := async.RetryConfig{MaxAttempts: 3, Delay: time.Second}Tips
All async helpers respect context cancellation — prefer them over raw goroutines when you need timeouts.
Standard library alternative
gox wraps the Go standard library or a trusted dependency with Node-familiar naming. You can use the underlying library directly — see the package overview for escape hatches.