you `race` with an `IO.sleep`
# arrow
p
you
race
with an
IO.sleep
🔝 1
r
Do you have a better way? I have an IO that calls
delay
inside
tailrecM
because it is waiting on a 3rd party API to return a certain status code. It could theoretically wait "forever", so I wanted a way of cancelling it from a higher level (I know I could add a retry counter in the
tailrecM
).
p
racing cancels the other side, it’s the API that you want, and you’re building timeout from basic blocks 😄