Retry

Sarath Kallatt Sivasankaran
1 min readMar 31, 2019

--

One day at work, there was a little piece of code which did a retry until the call succeeded or reached a max number of retries. It looked something like this

Obviously at a later stage we wanted to add a delay between retries. Removing all the complexity of a RetryPolicy, lets stick to a fixed delay between retries. And here is a simple version

If you want another example for Retry (for http requests), then we can also have look at http4s code. here it is

--

--

No responses yet