Jitter

com.softinio.verdict4s.Jitter
See theJitter companion object
trait Jitter[F[_]]

Where a retry delay's randomness comes from.

A two-method trait rather than a direct call to a random source, for two reasons. Tests get a fully deterministic schedule from Jitter.constant without a mocking library. And the obvious alternatives are both worse here: cats.effect.std.Random is only transitively on the classpath, and deriving randomness from Temporal.monotonic yields a constant on Scala.js, where the clock is millisecond-granular.

This lives in the client, not in algebra, because drawing a sample is an effect and the core must stay effect-free.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def sample: F[Double]

A fresh sample in [0, 1).

A fresh sample in [0, 1).

Attributes