Retries the effect only while a predicate over the error holds.
Useful for selective retry policies — e.g. retry HTTP 5xx but not 4xx,
retry network errors but not validation errors. The predicate is evaluated
BEFORE each retry; returning false short-circuits and re-fails with the
original error.
Optional ReadonlydelayMs?: numberOptional fixed delay between attempts.
Readonlyn: numberMaximum number of retry attempts.
Readonlywhile: (error: E, attempt: number) => booleanPredicate (error, attempt) => boolean (attempt is 1-indexed
for the first retry; if the predicate returns false, the retry is skipped).
Retries the effect with exponential backoff and optional full jitter.
Delay schedule: min(maxMs, baseMs * factor^(attempt-1)). With jitter
enabled, the actual delay is computed * (0.5 + Math.random() * 0.5)
(full jitter, 50–100% of the computed value) — prevents thundering herd.
ReadonlybaseMs: numberInitial delay before the first retry.
Optional Readonlyfactor?: numberBackoff multiplier per attempt. Defaults to 2.
Optional Readonlyjitter?: booleanApply full jitter (50–100% of computed delay). Defaults to true.
Optional ReadonlymaxMs?: numberCap on per-attempt delay. Defaults to 30_000.
Readonlyn: numberMaximum number of retry attempts.
Optional Readonlywhile?: (error: E, attempt: number) => booleanOptional predicate (error, attempt) => boolean gating each retry.
Fails with TimeoutError if the effect doesn't complete within the specified duration.
Maximum time in milliseconds
Converts to JSON representation.
Converts to string representation.
Makes IO iterable for generator do-notation (yield* syntax). Yields the IO itself, allowing IO.gen to extract the value.