Production-grade resilience strategies modeled as Mealy machine automata — built on the Picea kernel.
Mariana provides resilience patterns where each strategy (retry, circuit breaker, etc.) is a Mealy machine automaton. This means:
- Strategies are pure state machines — deterministic, testable, composable
- State transitions are explicit — you can inspect and trace the strategy's behavior
- No hidden threading primitives — the kernel handles concurrency
- OpenTelemetry built-in — every strategy emits spans via
ActivitySource
| Strategy | Description |
|---|---|
| Retry | Retry failed operations with configurable backoff (constant, linear, exponential, decorrelated jitter) |
| Circuit Breaker | Stop calling a failing dependency; trip → half-open → close cycle |
| Timeout | Fail fast when an operation exceeds a time budget |
| Fallback | Provide a substitute result when the primary operation fails |
| Rate Limiter | Token-bucket rate limiting to protect downstream services |
| Hedging | Race parallel attempts against a deadline for latency-sensitive paths |
Strategies compose into pipelines — sequential chains where each strategy wraps the next:
// Retry → Circuit Breaker → Timeout
var pipeline = Pipeline.Create(
retryStrategy,
circuitBreakerStrategy,
timeoutStrategy
);dotnet add package Picea.Mariana| Package | Description | Repo |
|---|---|---|
| Picea | Core kernel: Automaton<>, Result<>, Decider<> |
picea/picea |
| Picea.Mariana | Resilience patterns (this repo) | picea/mariana |
| Picea.Abies | MVU framework for Blazor | picea/abies |
| Picea.Glauca | Event Sourcing patterns | picea/glauca |
| Picea.Rubens | Actor model patterns | picea/rubens |
Apache-2.0 — Copyright 2025 Maurice Peters