Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Add notes to use Polly.RateLimiting package #1672

Merged
Changes from 1 commit
Commits
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
9 changes: 9 additions & 0 deletions docs/migration-v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,9 @@ IAsyncPolicy<HttpResponseMessage> asyncPolicyT = Policy.RateLimitAsync<HttpRespo

### Rate limit in v8

> [!NOTE]
> In v8, you have to add the `Polly.RateLimiting` package to your application otherwise you won't see the `AddRateLimiter` extension.
peter-csala marked this conversation as resolved.
Show resolved Hide resolved

<!-- snippet: migration-rate-limit-v8 -->
```cs
// The equivalent to Polly v7's RateLimit is the SlidingWindowRateLimiter.
Expand Down Expand Up @@ -476,6 +479,9 @@ IAsyncPolicy<HttpResponseMessage> asyncPolicyT = Policy.BulkheadAsync<HttpRespon

### Bulkhead in v8

> [!NOTE]
> In v8, you have to add the `Polly.RateLimiting` package to your application otherwise you won't see the `AddConcurrencyLimiter` extension.

<!-- snippet: migration-bulkhead-v8 -->
```cs
// Create pipeline with concurrency limiter. Because ResiliencePipeline supports both sync and async
Expand Down Expand Up @@ -779,6 +785,9 @@ registry.GetOrAddPipeline("my-key", builder => builder.AddTimeout(TimeSpan.FromS

In certain scenarios, you might not want to migrate your code to the v8 API. Instead, you may prefer to use strategies from v8 and apply them to v7 APIs. Polly provides a set of extension methods to support easy conversion from v8 to v7 APIs, as shown in the example below:

> [!NOTE]
> In v8, you have to add the `Polly.RateLimiting` package to your application otherwise you won't see the `AddRateLimiter` extension.

<!-- snippet: migration-interoperability -->
```cs
// First, create a resilience pipeline.
Expand Down