Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Note that this assumes that non-Unit values are silently thrown away, which you should always configure scalac, preferably via sbt-tpolecat, not to allow.
To try to answer the top-level question "Why are effects better for retries than Future?" I would say "because the effect types rest on a runtime that supports cancellation and error-handling with rigorous algebraic semantics." If we look at cats-retry, for example, we find implementations that require a Monad and a Sleep instance or a MonadError and a Sleep instance. The Sleep typeclass, probably unsurprisingly, just exposes a sleep effect. But look at the companion object: the only instance of the typeclass it provides is for type constructors with a cats-effect Temporal instance. IO has such an instance. Future does not, and cannot.