LOADING

Retrying the retry design

In this talk, I will discuss why it's hard to use the power of RT to test side-effect-heavy apps.

Michał Płachta
Author of "Grokking Functional Programming"
About This Talk

Retrying failed side-effectful actions is the bread & butter for all programmers. Whether you use Python, Ruby, Java, or Scala, you’ll use the same retry strategies: usually some backoff and randomness.

In functional Scala, we use the powers of referential transparency (RT). If your API call is described as an IO value, you just create a new IO value that adds the retry logic of your choice. Easy, right?

Things get nasty very quickly when an API or a DB you call has more constraints. Imagine a retry strategy that starts with a 5ms delay and uses a Fibonacci backoff, but each individual delay is capped at 5s and you always do a final retry after the timeout passes. How would you make sure it’s working correctly? Is referential transparency helpful?

In this talk, I will discuss why it's hard to use the power of RT to test side-effect-heavy apps. The main problem is that our APIs and library APIs don't use the full power of RT: they focus too much on side effects and not the value representation of these side effects. This in turn makes testing such apps very difficult. I will present some alternative ideas for a better, more RT-friendly design for retries and many more side-effectful APIs.

more great talks

Might Be Interesting

Day 1
  —  
arrow pointing right icon

Programming a Language

In this talk, I will show you how to create a programming language from scratch.

Day 2
  —  
arrow pointing right icon

Scala Sampler for Functional Soundscapes

Discover how functional programming can inspire creativity with the Scala Sampler, a digital music instrument developed for the Sounds of Scala web audio library.

Day 1
  —  
arrow pointing right icon

Better Scala builds with the Mill build tool

This talk will introduce Mill: a newer build tool that does everything SBT does, but better. Faster, simpler, easier, Mill democratizes the build so you don't need to be a build tool expert to work on it.

Day 1
  —  
arrow pointing right icon

From Zero to Production Faster Than Your Average Meeting with Pillars

I will demonstrate how Pillars can take you from zero to production in record time. By leveraging Pillars’ integration of well-known libraries, you can bypass the usual complexities of setting up observability (traces, metrics, and logs), database access, API calls, and feature flag management.

Day 1
  —  
arrow pointing right icon

Do You Even Macro?

In this talk, we'll cover the essentials of macros, why they are useful, why you should care about them, and how to become as good as you need with them for practical purposes.

Day 2
  —  
arrow pointing right icon

Tagless Final for Humans

In this talk, I'll look at the different uses to which tagless final is put to, and see what we can learn about when it is useful and when it just gets in the way.

See All Events
Join us!

We're looking for amazing speakers.
CFP is open till 10.01.2023

Fill in Call for Papers
location icon

Location

Centrum Konferencyjne POLIN, Poland
stay in touch icon

Follow Us

Contact Us