eapache / go-resiliency

Resiliency patterns for golang
https://godoc.org/github.com/eapache/go-resiliency
MIT License
2.23k stars 145 forks source link

infinite retries #53

Open egorlepa opened 1 month ago

egorlepa commented 1 month ago

add support for infinite retries somehow? I can of course do

ConstantBackoff(math.MaxInt32) 

but it'll allocate a huge array

perhaps an option to simply repeat last duration or ability to pass a function for lazy evaluation instead of []Duration or make use of rangefuncs of go 1.23 to provide a lazy evaluated infinite range of durations

eapache commented 1 month ago

I'm not sure that there's much value in this library supporting infinite retries, that's basically just a for { } loop which you don't need a library for?

eapache commented 1 month ago

In general, the cases where you need infinite retries are not "resiliency" cases so much.