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

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

What are your thoughts?