| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Rules.Effectful
Description
The resilience harness around the advisory package read: a per-attempt timeout, bounded retry
with backoff, and a per-rule circuit breaker, attached by prepare.
Returned values settle success. Exhausted faults count once per run. Cancellation propagates and releases an owned recovery probe without counting a source failure.
Synopsis
- data Resilience = Resilience {}
- data EffectfulConfig = EffectfulConfig {}
- defaultEffectfulConfig :: EffectfulConfig
- newBreaker :: IO (TVar Breaker)
- runResilient :: Resilience -> IO a -> IO (Either ReadFault a)
- data ReadFault = ReadFault {}
The resilience policy
data Resilience Source #
The resilience policy around one advisory rule's reads. Each rule holds its own breaker state.
Constructors
| Resilience | |
Fields
| |
data EffectfulConfig Source #
Per-rule limits. Breaker timing uses the fresh resClock, separate from request snapshots.
Constructors
| EffectfulConfig | |
Fields
| |
defaultEffectfulConfig :: EffectfulConfig Source #
Timeout 2s, retries after 100ms and 250ms, trip after five failed runs, cooldown 30s.
newBreaker :: IO (TVar Breaker) Source #
A fresh, healthy breaker (no failures recorded) in a new TVar.
Running a read through it
runResilient :: Resilience -> IO a -> IO (Either ReadFault a) Source #
Run one read under its Resilience policy: the read's value, or why the harness gave it up.
Why the harness gave a read up. Each rule relying on it resolves this under its own alignment.
Constructors
| ReadFault | |
Fields
| |