-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Welcome to the Murphy for Delphi documentation! Murphy is a comprehensive Chaos Engineering library for Delphi that provides ready-to-use implementations of nine common resilience and fault-tolerance patterns.
Important
Warning: some of this documentation was generated or reworked with an LLM tool (Claude). It may therefore contain errors and/or inaccuracies. If you encounter any, please report the issue or propose a fix by submitting a pull request.
- Introduction - What is Murphy and why use it
- Getting Started - Installation and first steps
- Chaos Engineering Basics - Understanding Chaos Engineering principles
- Architecture - Design principles and internal architecture
-
API Reference Index
- Base Policy - Core interfaces and base classes
- Retry Policy - Retry pattern API
- Circuit Breaker Policy - Circuit Breaker pattern API
- Fallback Policy - Fallback pattern API
- Rate Limit Policy - Rate Limit pattern API
- Timeout Policy - Timeout pattern API
- Bulkhead Policy - Bulkhead pattern API
- Cache Policy - Cache pattern API
- Hedging Policy - Hedging pattern API
- Policy Wrap - Policy composition API
- Retry Pattern - Automatic retry with configurable delays
- Circuit Breaker Pattern - Prevent cascading failures
- Fallback Pattern - Provide alternative results on failure
- Rate Limit Pattern - Control operation rate
- Timeout Pattern - Abort operations that take too long
- Bulkhead Pattern - Isolate resources by limiting concurrency
- Cache Pattern - Cache expensive results, serve stale data on failure
- Hedging Pattern - Reduce tail latency with parallel attempts
- Policy Wrap - Combine multiple policies into one
- Combining Patterns - Advanced: Using multiple patterns together
- Testing with Murphy - Unit testing and test mode
- Best Practices - Recommendations and common pitfalls
- Contributing - How to contribute to Murphy
# Using Blocks package manager
blocks install marcobreveglieri.murphy-delphiuses Murphy.Policy.Retry;
var
RetryPolicy: IRetryPolicy;
begin
// Create a retry policy
RetryPolicy := TRetryBuilder.Create
.Handle(EIdHTTPProtocolException)
.Retry(3)
.Wait(TTimeSpan.FromSeconds(1))
.Build;
// Execute code with automatic retry
RetryPolicy.Execute(
procedure
begin
// Your code here - will be retried on failure
MakeHttpRequest;
end);
end;| Pattern | Purpose | Use Case |
|---|---|---|
| Retry | Automatically retry failed operations | Transient network errors, temporary service unavailability |
| Circuit Breaker | Prevent cascading failures | Protect against persistent downstream failures |
| Fallback | Provide alternative results | Return cached data, default values, or degraded functionality |
| Rate Limit | Control operation rate | Prevent API throttling, protect resource consumption |
| Timeout | Abort operations that take too long | Slow network calls, unresponsive services, enforcing SLAs |
| Bulkhead | Limit concurrent executions | Protect connection pools, isolate workloads, cap parallel work |
| Cache | Cache expensive results for a duration | Expensive lookups, remote configuration, reducing backend load |
| Hedging | Launch parallel attempts, return the first success | Tail-latency reduction, replicated services, flaky endpoints |
| Policy Wrap | Combine multiple policies into one | Sophisticated resilience strategies, combining retry/timeout/circuit breaker |
- Delphi 11 Alexandria or later
- Supports Windows (Win32, Win64)
Murphy for Delphi is released under the MIT License. See the LICENSE file for details.
We welcome contributions! Please see our Contributing Guide for details on how to get started.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Next Steps: Start with the Introduction to learn more about Murphy, or jump straight to Getting Started to begin using the library.