Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
26f75ea
Unify Timeout, Retry
peter-csala Apr 15, 2024
40bf86f
Merge branch 'App-vNext:main' into unify-strategy-descriptions
peter-csala Apr 15, 2024
547553e
Add runtime to the wordlist
peter-csala Apr 15, 2024
950a84c
Fix heading
peter-csala Apr 15, 2024
fa7b6ba
Apply suggestions from code review
peter-csala Apr 15, 2024
8f6cbc5
Apply suggestions
peter-csala Apr 15, 2024
4c46442
Unify Fallback
peter-csala Apr 16, 2024
ac1a2bb
Unify Hedging
peter-csala Apr 16, 2024
44b9937
Fix linting issue related to italic usage
peter-csala Apr 16, 2024
fe6f713
Unify Rate limiter
peter-csala Apr 17, 2024
5ffd9c8
Apply suggestions from code review
peter-csala Apr 17, 2024
1a2452a
Use note instead of important
peter-csala Apr 17, 2024
661b8d5
Unify Circuit Breaker
peter-csala Apr 17, 2024
67e8331
Fix table formatting
peter-csala Apr 17, 2024
1b2d1d5
Apply suggestions from code review
peter-csala Apr 17, 2024
a046c8f
Fix table format
peter-csala Apr 17, 2024
94ee246
Add telemetry section to timeout
peter-csala Apr 18, 2024
3b9cab6
Remove unused variable
peter-csala Apr 18, 2024
e64edad
Add telemetry section to retry
peter-csala Apr 18, 2024
ccae18c
Update docs/strategies/timeout.md
peter-csala Apr 18, 2024
6a9a59f
Add telemetry section to fallback
peter-csala Apr 18, 2024
1a40202
Update docs/strategies/retry.md
peter-csala Apr 18, 2024
d81f3e4
Fix note section for fallback telemetry
peter-csala Apr 18, 2024
552a0e2
Add telemetry to rate limiter
peter-csala Apr 19, 2024
d6e1334
Add telemetry section to hedging
peter-csala Apr 19, 2024
eed98a8
Remove extra whitespace
peter-csala Apr 19, 2024
20fe470
Add telemetry section to circuit breaker
peter-csala Apr 19, 2024
6f10f8d
Fix cb telemetry events' severity
peter-csala Apr 19, 2024
fc494c3
Apply suggestions from code review
peter-csala Apr 22, 2024
899a5c4
Apply suggested changes
peter-csala Apr 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Unify Fallback
  • Loading branch information
peter-csala committed Apr 16, 2024
commit 4c464424cecca32137550628c2c5e5a461c2d1c4
24 changes: 16 additions & 8 deletions docs/strategies/fallback.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@

## About

- **Options**: [`FallbackStrategyOptions<T>`](xref:Polly.Fallback.FallbackStrategyOptions`1)
- **Extensions**: `AddFallback`
- **Strategy Type**: Reactive
- **Option(s)**:
- [`FallbackStrategyOptions<T>`](xref:Polly.Fallback.FallbackStrategyOptions`1)
- **Extension(s)**:
- `AddFallback`
- **Exception(s)**: -

---

The fallback **reactive** resilience strategy provides a substitute if the execution of the callback fails. Failure can be either an `Exception` or a result object indicating unsuccessful processing. Typically this strategy is used as a last resort, meaning that if all other strategies failed to overcome the transient failure you could still provide a fallback value to the caller.

> [!NOTE]
> In this document the *fallback*, *substitute*, and *surrogate* terms are used interchangeably.

## Usage

<!-- snippet: fallback -->
Expand Down Expand Up @@ -59,11 +66,12 @@ new ResiliencePipelineBuilder<UserAvatar>().AddFallback(optionsOnFallback);

## Defaults

| Property | Default Value | Description |
| ---------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `ShouldHandle` | Predicate that handles all exceptions except `OperationCanceledException`. | Predicate that determines what results and exceptions are handled by the fallback strategy. |
| `FallbackAction` | `Null`, **Required** | Fallback action to be executed. |
| `OnFallback` | `null` | Event that is raised when fallback happens. |
| Property | Default Value | Description |
|----------------|---------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| `ShouldHandle` | Any exceptions other than `OperationCanceledException`. | Defines a predicate to determine what results and/or exceptions are handled by the fallback strategy. |

| `FallbackAction` | `Null`, **Required** | This delegate allows you to **dynamically** calculate the surrogate value by utilizing information that is only available at runtime (like the outcome). |
| `OnFallback` | `null` | If provided then it will be invoked before the strategy calculates the fallback value. |

## Diagrams

Expand Down
2 changes: 1 addition & 1 deletion docs/strategies/retry.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

---

The retry **reactive** resilience strategy re-executes the same callback method if its execution fails. Failure can be an `Exception` or a result object indicating unsuccessful processing. Between the retry attempts the retry strategy waits a specified amount of time. You have fine-grained control over how to calculate the next delay. The retry strategy stops invoking the same callback when it reaches the maximum allowed number of retry attempts or an unhandled exception is thrown / result object indicating a failure is returned.
The retry **reactive** resilience strategy re-executes the same callback method if its execution fails. Failure can be either an `Exception` or a result object indicating unsuccessful processing. Between the retry attempts the retry strategy waits a specified amount of time. You have fine-grained control over how to calculate the next delay. The retry strategy stops invoking the same callback when it reaches the maximum allowed number of retry attempts or an unhandled exception is thrown / result object indicating a failure is returned.

## Usage

Expand Down