From 96f18fdcd8f66955bc4ac4fd8343929df4993398 Mon Sep 17 00:00:00 2001 From: Martin Tomka Date: Mon, 18 Sep 2023 08:49:46 +0200 Subject: [PATCH] Cleanup --- docs/index.md | 68 +++++++++++++++++----------------------- docs/migration-v8.md | 1 + docs/strategies/index.md | 6 ++-- docs/toc.yml | 3 ++ 4 files changed, 36 insertions(+), 42 deletions(-) create mode 100644 docs/migration-v8.md diff --git a/docs/index.md b/docs/index.md index 93d79bc78f0..8c6f807cdff 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,57 +1,45 @@ -# Polly Documentation +# Meet Polly: The .NET resilience library -Polly is a .NET resilience and transient-fault-handling library that allows developers to express resilience strategies such as Retry, Circuit Breaker, Hedging, Timeout, Rate Limiter and Fallback in a fluent and thread-safe manner. +![Polly logo](https://raw.github.com/App-vNext/Polly/main/Polly-Logo.png) -We are a member of the [.NET Foundation](https://www.dotnetfoundation.org/about)! +Polly is a powerful library for .NET that helps you handle transient faults and improve the resilience of your applications. With Polly, you can easily define and apply strategies such as Retry, Circuit Breaker, Hedging, Timeout, Rate Limiter and Fallback to handle failures and slowdowns in a fluent and thread-safe way. -![Polly logo](https://raw.github.com/App-vNext/Polly/main/Polly-Logo.png) +Polly is part of the [.NET Foundation](https://www.dotnetfoundation.org/about)! ## What can Polly do for you? -Polly lets you express different resilience strategies to cope with various scenarios, such as: +Polly lets you use and combine different resilience strategies to cope with various scenarios, such as: -- [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. +- [Retry](strategies/retry.md): Try again if something fails. This can be useful when the problem is temporary and might go away. +- [Circuit Breaker](strategies/circuit-breaker.md): Stop trying if something is broken or busy. This can benefit you by avoiding wasting time and making things worse. It can also support the system to recover. +- [Timeout](strategies/timeout.md): Give up if something takes too long. This can improve your performance by freeing up space and resources. +- [Rate Limiter](strategies/rate-limiter.md): Limit how many requests you make or accept. This can enable you to control the load and prevent problems or penalties. +- [Fallback](strategies/fallback.md): Do something else if something fails. This can improve your user experience and keep the program working. +- [Hedging](strategies/hedging.md): Do more than one thing at the same time and take the fastest one. This can make your program faster and more responsive. -You can learn more about each strategy and how to configure it in the [resilience strategies](strategies/index.md) section. +You can learn more about each strategy and how to use them [resilience strategies](strategies/index.md) section. -## Getting started +## How to get started with Polly? -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. +Polly is easy to install and use. You can follow the [getting started](getting-started.md) guide to add Polly to your project and use it for your requests. -## Articles +## Where to find more information? -- [Introduction](index.md): General information about the project and its goals. -- [Getting started](getting-started.md): A guide to help you get started with the project. -- Resilience strategies: A collection of strategies for improving the resilience of your system. - - [Timeout](strategies/timeout.md): A strategy for setting a maximum time limit for a request. - - [Retry](strategies/retry.md): A strategy for retrying failed requests. - - [Rate limiter](strategies/rate-limiter.md): A strategy for limiting the rate of requests. - - [Hedging](strategies/hedging.md): A strategy for hedging against long request times. - - [Fallback](strategies/fallback.md): A strategy for providing a fallback response in case of failure. - - [Circuit breaker](strategies/circuit-breaker.md): A strategy for breaking the circuit when a system is down. -- Resilience pipelines: Understanding the use of resilience pipelines. - - [Resilience pipeline registry](pipelines/resilience-pipeline-registry.md): Exploring the registry that stores resilience pipelines. -- vanced topics: A collection of advanced topics for further learning. - - [Telemetry and monitoring](advanced/telemetry.md): Insights into telemetry generated by resilience pipelines and strategies. - - [Chaos engineering](advanced/simmy.md): Get to know chaos engineering via the project's capabilities. - - [Dependency injection](advanced/dependency-injection.md): How the project integrates with Dependency Injection. -- Community and resources: A collection of resources and community contributions. - - [Polly-Contrib projects and libraries](community/polly-contrib.md): Learn how to contribute to and extend the project ecosystem. - - [Libraries and contributions](community/libraries-and-contributions.md): Find out which libraries the project depends on and who contributes to its development. - - [Useful resources and links](community/resources.md): Browse through blogs, podcasts, courses, e-books, and other community resources. -- [API](api/index.md): The API documentation for the project. +Polly has a rich documentation that covers various topics, such as: -## Articles (previous Polly versions) +- [Resilience strategies](strategies/index.md): A collection of strategies for improving the resilience of your system. +- [Resilience pipelines](pipelines/index.md): How to combine and reuse strategies in a flexible and modular way. +- [Telemetry and monitoring](advanced/telemetry.md): How to access and analyze the data generated by Polly strategies and pipelines. +- [Dependency injection](advanced/dependency-injection.md): How to integrate Polly with dependency injection frameworks and containers. +- [Extensibility](advanced/extensibility.md): How to create and use custom strategies and extensions for Polly. +- [Chaos engineering](advanced/simmy.md): How to use Polly to inject faults and test the resilience of your system. -- [Extensibility (v7)](v7/extensibility.md): Learn how you can extend Polly with new policies. - -## Samples +You can also find many resources and community contributions, such as: - [Samples](https://github.com/App-vNext/Polly/tree/main/samples): Samples in this repository that serve as an introduction to Polly. -- [Polly-Samples](https://github.com/App-vNext/Polly-Samples): Contains practical examples for using various implementations of Polly. Please feel free to contribute to the Polly-Samples repository in order to assist others who are either learning Polly for the first time, or are seeking advanced examples and novel approaches provided by our generous community. +- [Practical Samples](https://github.com/App-vNext/Polly-Samples): Practical examples for using various implementations of Polly. Please feel free to contribute to the Polly-Samples repository in order to assist others who are either learning Polly for the first time, or are seeking advanced examples and novel approaches provided by our generous community. +- [Polly-Contrib](community/polly-contrib.md)): Community projects and libraries that extend and enhance Polly's functionality and ecosystem. +- [Libraries and contributions](community/libraries-and-contributions.html): Dependencies and contributors that make Polly possible and awesome. - Microsoft's [eShopOnContainers project](https://github.com/dotnet-architecture/eShopOnContainers): Sample project demonstrating a .NET Microservices architecture and using Polly for resilience. + +You can browse the documentation using the sidebar or visit the [API](api/index.md) section for the reference documentation. diff --git a/docs/migration-v8.md b/docs/migration-v8.md new file mode 100644 index 00000000000..5be94d682ba --- /dev/null +++ b/docs/migration-v8.md @@ -0,0 +1 @@ +# Migration guide from v7 to v8 diff --git a/docs/strategies/index.md b/docs/strategies/index.md index a6e071b8f99..ba90dc3d78b 100644 --- a/docs/strategies/index.md +++ b/docs/strategies/index.md @@ -10,10 +10,12 @@ 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). +## Built-in strategies + | 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. | +|[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. | @@ -21,7 +23,7 @@ Polly categorizes resilience strategies into two main groups: ## 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. +Extensions for adding resilience strategies to e 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. Each resilience strategy provides: diff --git a/docs/toc.yml b/docs/toc.yml index cab21e5f685..8d2c16f1158 100644 --- a/docs/toc.yml +++ b/docs/toc.yml @@ -4,6 +4,9 @@ - name: Getting started href: getting-started.md +- name: Migrate to v8 + href: migration-v8.md + - name: Resilience strategies href: strategies/index.md expanded: true