Skip to content

Commit

Permalink
Fix sliding window ratelimiter examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Csala committed Jan 10, 2025
1 parent 4f0d44a commit 638fd73
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ new ResiliencePipelineBuilder()
new SlidingWindowRateLimiterOptions
{
PermitLimit = 100,
SegmentsPerWindow = 4,
Window = TimeSpan.FromMinutes(1)
}));
```
Expand Down
2 changes: 2 additions & 0 deletions docs/migration-v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ ResiliencePipeline pipeline = new ResiliencePipelineBuilder()
.AddRateLimiter(new SlidingWindowRateLimiter(new SlidingWindowRateLimiterOptions
{
PermitLimit = 100,
SegmentsPerWindow = 4,
Window = TimeSpan.FromMinutes(1),
}))
.Build();
Expand All @@ -479,6 +480,7 @@ ResiliencePipeline<HttpResponseMessage> pipelineT = new ResiliencePipelineBuilde
.AddRateLimiter(new SlidingWindowRateLimiter(new SlidingWindowRateLimiterOptions
{
PermitLimit = 100,
SegmentsPerWindow = 4,
Window = TimeSpan.FromMinutes(1),
}))
.Build();
Expand Down
1 change: 1 addition & 0 deletions docs/strategies/rate-limiter.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ new ResiliencePipelineBuilder()
new SlidingWindowRateLimiterOptions
{
PermitLimit = 100,
SegmentsPerWindow = 4,
Window = TimeSpan.FromMinutes(1)
}));
```
Expand Down
1 change: 1 addition & 0 deletions src/Polly.RateLimiting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ new ResiliencePipelineBuilder()
new SlidingWindowRateLimiterOptions
{
PermitLimit = 100,
SegmentsPerWindow = 4,
Window = TimeSpan.FromMinutes(1)
}));
```
Expand Down
2 changes: 2 additions & 0 deletions src/Snippets/Docs/Migration.RateLimiter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static void RateLimiter_V8()
.AddRateLimiter(new SlidingWindowRateLimiter(new SlidingWindowRateLimiterOptions
{
PermitLimit = 100,
SegmentsPerWindow = 4,
Window = TimeSpan.FromMinutes(1),
}))
.Build();
Expand All @@ -55,6 +56,7 @@ public static void RateLimiter_V8()
.AddRateLimiter(new SlidingWindowRateLimiter(new SlidingWindowRateLimiterOptions
{
PermitLimit = 100,
SegmentsPerWindow = 4,
Window = TimeSpan.FromMinutes(1),
}))
.Build();
Expand Down
1 change: 1 addition & 0 deletions src/Snippets/Docs/RateLimiter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static void Usage()
new SlidingWindowRateLimiterOptions
{
PermitLimit = 100,
SegmentsPerWindow = 4,
Window = TimeSpan.FromMinutes(1)
}));

Expand Down

0 comments on commit 638fd73

Please sign in to comment.