From 52889c84693eb71df221aa1ac416f69a5c608127 Mon Sep 17 00:00:00 2001 From: Martin Tomka Date: Fri, 15 Sep 2023 16:05:16 +0200 Subject: [PATCH] Cleanup --- docs/index.md | 24 ++++++++++++------------ docs/strategies/index.md | 9 +++++++++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/docs/index.md b/docs/index.md index 6f2cea676b2..93d79bc78f0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,22 +6,22 @@ We are a member of the [.NET Foundation](https://www.dotnetfoundation.org/about) ![Polly logo](https://raw.github.com/App-vNext/Polly/main/Polly-Logo.png) -## Resilience strategies +## What can Polly do for you? -| Strategy | Reactive | Premise | AKA | How does the strategy mitigate?| -| ------------- | --- | ------------- |:-------------: |------------- | -|[Retry](strategies/retry.md) |Yes|Many faults are transient and may self-correct after a short delay.| *Maybe it's just a blip* | Allows configuring automatic retries. | -|[Circuit-breaker](strategies/circuit-breaker.md) |Yes|When a system is seriously struggling, failing fast is better than making users/callers wait.

Protecting a faulting system from overload can help it recover. | *Stop doing it if it hurts*

*Give that system a break* | Breaks the circuit (blocks executions) for a period, when faults exceed some pre-configured threshold. | -|[Timeout](strategies/timeout.md)|No|Beyond a certain wait, a success result is unlikely.| *Don't wait forever* |Guarantees the caller won't have to wait beyond the timeout. | -|[Rate Limiter](strategies/rate-limiter.md)|No|Limiting the rate a system handles requests is another way to control load.

This can apply to the way your system accepts incoming calls, and/or to the way you call downstream services. | *Slow down a bit, will you?* |Constrains executions to not exceed a certain rate. | -|[Fallback](strategies/fallback.md)|Yes|Things will still fail - plan what you will do when that happens.| *Degrade gracefully* |Defines an alternative value to be returned (or action to be executed) on failure. | -|[Hedging](strategies/hedging.md)|Yes|Things can be slow sometimes, plan what you will do when that happens.| *Hedge your bets* | Executes parallel actions when things are slow and waits for the fastest one. | +Polly lets you express different resilience strategies to cope with various scenarios, such as: -Visit the [resilience strategies](strategies/index.md) section to understand their structure and explore various configuration methods. +- [Retry](strategies/retry.md): Automatically retry failed requests after a short delay. Useful for transient errors that may self-correct. +- [Circuit Breaker](strategies/circuit-breaker.md): Fail fast and stop making requests when a system is overloaded or unhealthy. Useful for protecting a system from further damage and giving it time to recover. +- [Timeout](strategies/timeout.md): Set a maximum time limit for a request and abort it if it takes too long. Useful for avoiding indefinite waits and freeing up resources. +- [Rate Limiter](strategies/rate-limiter.md): Control the rate of requests to a system and reject or queue them if they exceed the limit. Useful for managing load and preventing throttling or overloading. +- [Fallback](strategies/fallback.md): Provide an alternative response or action in case of failure. Useful for degrading gracefully and maintaining user experience. +- [Hedging](strategies/hedging.md): Execute parallel requests when a system is slow and take the fastest one. Useful for reducing latency and improving responsiveness. -## Next steps +You can learn more about each strategy and how to configure it in the [resilience strategies](strategies/index.md) section. -Visit the [getting started](getting-started.md) section and learn how to quickly start using Polly. +## Getting started + +Polly is easy to install and use. You can follow the [getting started](getting-started.md) guide to set up Polly in your project and start applying resilience strategies in your projects. ## Articles diff --git a/docs/strategies/index.md b/docs/strategies/index.md index 81d1051669d..a6e071b8f99 100644 --- a/docs/strategies/index.md +++ b/docs/strategies/index.md @@ -10,6 +10,15 @@ Polly categorizes resilience strategies into two main groups: - **Reactive**: These strategies handle specific exceptions that are thrown, or results that are returned, by the callbacks executed through the strategy. - **Proactive**: Unlike reactive strategies, proactive strategies do not focus on handling errors by the callbacks might throw or return. They can make proactive decisions to cancel or reject the execution of callbacks (e.g., using a rate limiter or a timeout resilience strategy). +| Strategy | Reactive | Premise | AKA | How does the strategy mitigate?| +| ------------- | --- | ------------- |:-------------: |------------- | +|[Retry](retry.md) |Yes|Many faults are transient and may self-correct after a short delay.| *Maybe it's just a blip* | Allows configuring automatic retries. | +|[Circuit Breaker](circuit-breaker.md) |Yes|When a system is seriously struggling, failing fast is better than making users/callers wait.

Protecting a faulting system from overload can help it recover. | *Stop doing it if it hurts*

*Give that system a break* | Breaks the circuit (blocks executions) for a period, when faults exceed some pre-configured threshold. | +|[Timeout](timeout.md)|No|Beyond a certain wait, a success result is unlikely.| *Don't wait forever* |Guarantees the caller won't have to wait beyond the timeout. | +|[Rate Limiter](rate-limiter.md)|No|Limiting the rate a system handles requests is another way to control load.

This can apply to the way your system accepts incoming calls, and/or to the way you call downstream services. | *Slow down a bit, will you?* |Constrains executions to not exceed a certain rate. | +|[Fallback](fallback.md)|Yes|Things will still fail - plan what you will do when that happens.| *Degrade gracefully* |Defines an alternative value to be returned (or action to be executed) on failure. | +|[Hedging](hedging.md)|Yes|Things can be slow sometimes, plan what you will do when that happens.| *Hedge your bets* | Executes parallel actions when things are slow and waits for the fastest one. | + ## Usage Extensions for adding resilience strategies to the builders are provided by each strategy. Depending on the type of strategy, these extensions may be available for both `ResiliencePipelineBuilder` and `ResiliencePipelineBuilder` or just one of them. Proactive strategies like timeout or rate limiter are available for both types of builders, while specialized reactive strategies are only available for `ResiliencePipelineBuilder`. Adding multiple resilience strategies is supported.