Skip to content

Commit a5411de

Browse files
authored
ConcurrencyLimiter polishing and cleanup (#12127)
* renames and cleanup
1 parent 87a92e5 commit a5411de

31 files changed

+167
-186
lines changed

eng/ProjectReferences.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Authorization" ProjectPath="$(RepoRoot)src\Security\Authorization\Core\src\Microsoft.AspNetCore.Authorization.csproj" RefProjectPath="$(RepoRoot)src\Security\Authorization\Core\ref\Microsoft.AspNetCore.Authorization.csproj" />
7474
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Authorization.Policy" ProjectPath="$(RepoRoot)src\Security\Authorization\Policy\src\Microsoft.AspNetCore.Authorization.Policy.csproj" RefProjectPath="$(RepoRoot)src\Security\Authorization\Policy\ref\Microsoft.AspNetCore.Authorization.Policy.csproj" />
7575
<ProjectReferenceProvider Include="Microsoft.AspNetCore.CookiePolicy" ProjectPath="$(RepoRoot)src\Security\CookiePolicy\src\Microsoft.AspNetCore.CookiePolicy.csproj" RefProjectPath="$(RepoRoot)src\Security\CookiePolicy\ref\Microsoft.AspNetCore.CookiePolicy.csproj" />
76+
<ProjectReferenceProvider Include="Microsoft.AspNetCore.ConcurrencyLimiter" ProjectPath="$(RepoRoot)src\Middleware\ConcurrencyLimiter\src\Microsoft.AspNetCore.ConcurrencyLimiter.csproj" RefProjectPath="$(RepoRoot)src\Middleware\ConcurrencyLimiter\ref\Microsoft.AspNetCore.ConcurrencyLimiter.csproj" />
7677
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Cors" ProjectPath="$(RepoRoot)src\Middleware\CORS\src\Microsoft.AspNetCore.Cors.csproj" RefProjectPath="$(RepoRoot)src\Middleware\CORS\ref\Microsoft.AspNetCore.Cors.csproj" />
7778
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Diagnostics.Abstractions" ProjectPath="$(RepoRoot)src\Middleware\Diagnostics.Abstractions\src\Microsoft.AspNetCore.Diagnostics.Abstractions.csproj" RefProjectPath="$(RepoRoot)src\Middleware\Diagnostics.Abstractions\ref\Microsoft.AspNetCore.Diagnostics.Abstractions.csproj" />
7879
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" ProjectPath="$(RepoRoot)src\Middleware\Diagnostics.EntityFrameworkCore\src\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj" RefProjectPath="$(RepoRoot)src\Middleware\Diagnostics.EntityFrameworkCore\ref\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj" />
@@ -87,7 +88,6 @@
8788
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Localization" ProjectPath="$(RepoRoot)src\Middleware\Localization\src\Microsoft.AspNetCore.Localization.csproj" RefProjectPath="$(RepoRoot)src\Middleware\Localization\ref\Microsoft.AspNetCore.Localization.csproj" />
8889
<ProjectReferenceProvider Include="Microsoft.AspNetCore.MiddlewareAnalysis" ProjectPath="$(RepoRoot)src\Middleware\MiddlewareAnalysis\src\Microsoft.AspNetCore.MiddlewareAnalysis.csproj" RefProjectPath="$(RepoRoot)src\Middleware\MiddlewareAnalysis\ref\Microsoft.AspNetCore.MiddlewareAnalysis.csproj" />
8990
<ProjectReferenceProvider Include="Microsoft.AspNetCore.NodeServices" ProjectPath="$(RepoRoot)src\Middleware\NodeServices\src\Microsoft.AspNetCore.NodeServices.csproj" RefProjectPath="$(RepoRoot)src\Middleware\NodeServices\ref\Microsoft.AspNetCore.NodeServices.csproj" />
90-
<ProjectReferenceProvider Include="Microsoft.AspNetCore.RequestThrottling" ProjectPath="$(RepoRoot)src\Middleware\RequestThrottling\src\Microsoft.AspNetCore.RequestThrottling.csproj" RefProjectPath="$(RepoRoot)src\Middleware\RequestThrottling\ref\Microsoft.AspNetCore.RequestThrottling.csproj" />
9191
<ProjectReferenceProvider Include="Microsoft.AspNetCore.ResponseCaching.Abstractions" ProjectPath="$(RepoRoot)src\Middleware\ResponseCaching.Abstractions\src\Microsoft.AspNetCore.ResponseCaching.Abstractions.csproj" RefProjectPath="$(RepoRoot)src\Middleware\ResponseCaching.Abstractions\ref\Microsoft.AspNetCore.ResponseCaching.Abstractions.csproj" />
9292
<ProjectReferenceProvider Include="Microsoft.AspNetCore.ResponseCaching" ProjectPath="$(RepoRoot)src\Middleware\ResponseCaching\src\Microsoft.AspNetCore.ResponseCaching.csproj" RefProjectPath="$(RepoRoot)src\Middleware\ResponseCaching\ref\Microsoft.AspNetCore.ResponseCaching.csproj" />
9393
<ProjectReferenceProvider Include="Microsoft.AspNetCore.ResponseCompression" ProjectPath="$(RepoRoot)src\Middleware\ResponseCompression\src\Microsoft.AspNetCore.ResponseCompression.csproj" RefProjectPath="$(RepoRoot)src\Middleware\ResponseCompression\ref\Microsoft.AspNetCore.ResponseCompression.csproj" />

src/Middleware/RequestThrottling/RequestThrottling.slnf renamed to src/Middleware/ConcurrencyLimiter/ConcurrencyLimiter.slnf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"solution": {
3-
"path": "..\\Middleware.sln",
3+
"path": "C:\\Users\\t-dygra\\Desktop\\AspNetCore\\src\\Middleware\\Middleware.sln",
44
"projects": [
55
"..\\Hosting\\Abstractions\\src\\Microsoft.AspNetCore.Hosting.Abstractions.csproj",
66
"..\\Hosting\\Hosting\\src\\Microsoft.AspNetCore.Hosting.csproj",
@@ -15,11 +15,11 @@
1515
"..\\Servers\\Kestrel\\Transport.Sockets\\src\\Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.csproj",
1616
"..\\http\\Headers\\src\\Microsoft.Net.Http.Headers.csproj",
1717
"..\\http\\http\\src\\Microsoft.AspNetCore.Http.csproj",
18-
"HttpsPolicy\\src\\Microsoft.AspNetCore.HttpsPolicy.csproj",
19-
"RequestThrottling\\sample\\RequestThrottlingSample.csproj",
20-
"RequestThrottling\\src\\Microsoft.AspNetCore.RequestThrottling.csproj",
21-
"RequestThrottling\\test\\Microsoft.AspNetCore.RequestThrottling.Tests.csproj",
22-
"RequestThrottling\\perf\\Microbenchmarks\\Microsoft.AspNetCore.RequestThrottling.Microbenchmarks.csproj"
18+
"ConcurrencyLimiter\\perf\\Microbenchmarks\\Microsoft.AspNetCore.ConcurrencyLimiter.Microbenchmarks.csproj",
19+
"ConcurrencyLimiter\\sample\\ConcurrencyLimiterSample.csproj",
20+
"ConcurrencyLimiter\\src\\Microsoft.AspNetCore.ConcurrencyLimiter.csproj",
21+
"ConcurrencyLimiter\\test\\Microsoft.AspNetCore.ConcurrencyLimiter.Tests.csproj",
22+
"HttpsPolicy\\src\\Microsoft.AspNetCore.HttpsPolicy.csproj"
2323
]
2424
}
2525
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>netcoreapp3.0</TargetFramework>
6-
<!--<StartupObject>Microsoft.AspNetCore.RequestThrottling.Microbenchmarks.Test</StartupObject>-->
6+
<!--<StartupObject>Microsoft.AspNetCore.ConcurrencyLimiter.Microbenchmarks.Test</StartupObject>-->
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<ProjectReference Include="..\..\test\Microsoft.AspNetCore.RequestThrottling.Tests.csproj" />
10+
<ProjectReference Include="..\..\test\Microsoft.AspNetCore.ConcurrencyLimiter.Tests.csproj" />
1111
</ItemGroup>
1212

1313
<ItemGroup>
1414
<Reference Include="BenchmarkDotNet" />
1515
<Reference Include="Microsoft.AspNetCore.BenchmarkRunner.Sources" />
16-
<Reference Include="Microsoft.AspNetCore.RequestThrottling" />
16+
<Reference Include="Microsoft.AspNetCore.ConcurrencyLimiter" />
1717
</ItemGroup>
1818
</Project>

src/Middleware/RequestThrottling/perf/Microbenchmarks/QueueEmptyOverhead.cs renamed to src/Middleware/ConcurrencyLimiter/perf/Microbenchmarks/QueueEmptyOverhead.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
using BenchmarkDotNet.Attributes;
66
using BenchmarkDotNet.Running;
77
using Microsoft.AspNetCore.Http;
8-
using Microsoft.AspNetCore.RequestThrottling.Tests;
8+
using Microsoft.AspNetCore.ConcurrencyLimiter.Tests;
99

10-
namespace Microsoft.AspNetCore.RequestThrottling.Microbenchmarks
10+
namespace Microsoft.AspNetCore.ConcurrencyLimiter.Microbenchmarks
1111
{
1212
public class QueueEmptyOverhead
1313
{
1414
private const int _numRequests = 20000;
1515

16-
private RequestThrottlingMiddleware _middlewareFIFO;
17-
private RequestThrottlingMiddleware _middlewareLIFO;
16+
private ConcurrencyLimiterMiddleware _middlewareFIFO;
17+
private ConcurrencyLimiterMiddleware _middlewareLIFO;
1818
private RequestDelegate _restOfServer;
1919

2020
[GlobalSetup]

src/Middleware/RequestThrottling/perf/Microbenchmarks/QueueFullOverhead.cs renamed to src/Middleware/ConcurrencyLimiter/perf/Microbenchmarks/QueueFullOverhead.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
using System.Threading.Tasks;
66
using BenchmarkDotNet.Attributes;
77
using Microsoft.AspNetCore.Http;
8-
using Microsoft.AspNetCore.RequestThrottling.Tests;
8+
using Microsoft.AspNetCore.ConcurrencyLimiter.Tests;
99

10-
namespace Microsoft.AspNetCore.RequestThrottling.Microbenchmarks
10+
namespace Microsoft.AspNetCore.ConcurrencyLimiter.Microbenchmarks
1111
{
1212
public class QueueFullOverhead
1313
{
1414
private const int _numRequests = 200;
1515
private int _requestCount = 0;
1616
private ManualResetEventSlim _mres = new ManualResetEventSlim();
1717

18-
private RequestThrottlingMiddleware _middleware_FIFO;
19-
private RequestThrottlingMiddleware _middleware_LIFO;
18+
private ConcurrencyLimiterMiddleware _middleware_FIFO;
19+
private ConcurrencyLimiterMiddleware _middleware_LIFO;
2020

2121
[Params(8)]
2222
public int MaxConcurrentRequests;

src/Middleware/RequestThrottling/ref/Microsoft.AspNetCore.RequestThrottling.csproj renamed to src/Middleware/ConcurrencyLimiter/ref/Microsoft.AspNetCore.ConcurrencyLimiter.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFrameworks>netcoreapp3.0</TargetFrameworks>
55
</PropertyGroup>
66
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
7-
<Compile Include="Microsoft.AspNetCore.RequestThrottling.netcoreapp3.0.cs" />
7+
<Compile Include="Microsoft.AspNetCore.ConcurrencyLimiter.netcoreapp3.0.cs" />
88
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
99
<Reference Include="Microsoft.Extensions.Logging.Abstractions" />
1010
<Reference Include="Microsoft.Extensions.Options" />

src/Middleware/RequestThrottling/ref/Microsoft.AspNetCore.RequestThrottling.netcoreapp3.0.cs renamed to src/Middleware/ConcurrencyLimiter/ref/Microsoft.AspNetCore.ConcurrencyLimiter.netcoreapp3.0.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,24 @@
33

44
namespace Microsoft.AspNetCore.Builder
55
{
6-
public static partial class RequestThrottlingExtensions
6+
public static partial class ConcurrencyLimiterExtensions
77
{
8-
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseRequestThrottling(this Microsoft.AspNetCore.Builder.IApplicationBuilder app) { throw null; }
8+
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseConcurrencyLimiter(this Microsoft.AspNetCore.Builder.IApplicationBuilder app) { throw null; }
99
}
1010
}
11-
namespace Microsoft.AspNetCore.RequestThrottling
11+
namespace Microsoft.AspNetCore.ConcurrencyLimiter
1212
{
13+
public partial class ConcurrencyLimiterMiddleware
14+
{
15+
public ConcurrencyLimiterMiddleware(Microsoft.AspNetCore.Http.RequestDelegate next, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, Microsoft.AspNetCore.ConcurrencyLimiter.IQueuePolicy queue, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.ConcurrencyLimiter.ConcurrencyLimiterOptions> options) { }
16+
[System.Diagnostics.DebuggerStepThroughAttribute]
17+
public System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext context) { throw null; }
18+
}
19+
public partial class ConcurrencyLimiterOptions
20+
{
21+
public ConcurrencyLimiterOptions() { }
22+
public Microsoft.AspNetCore.Http.RequestDelegate OnRejected { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
23+
}
1324
public partial interface IQueuePolicy
1425
{
1526
void OnExit();
@@ -21,23 +32,12 @@ public QueuePolicyOptions() { }
2132
public int MaxConcurrentRequests { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
2233
public int RequestQueueLimit { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
2334
}
24-
public partial class RequestThrottlingMiddleware
25-
{
26-
public RequestThrottlingMiddleware(Microsoft.AspNetCore.Http.RequestDelegate next, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, Microsoft.AspNetCore.RequestThrottling.IQueuePolicy queue, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.RequestThrottling.RequestThrottlingOptions> options) { }
27-
[System.Diagnostics.DebuggerStepThroughAttribute]
28-
public System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext context) { throw null; }
29-
}
30-
public partial class RequestThrottlingOptions
31-
{
32-
public RequestThrottlingOptions() { }
33-
public Microsoft.AspNetCore.Http.RequestDelegate OnRejected { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
34-
}
3535
}
3636
namespace Microsoft.Extensions.DependencyInjection
3737
{
3838
public static partial class QueuePolicyServiceCollectionExtensions
3939
{
40-
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddStackQueue(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action<Microsoft.AspNetCore.RequestThrottling.QueuePolicyOptions> configure) { throw null; }
41-
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddTailDropQueue(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action<Microsoft.AspNetCore.RequestThrottling.QueuePolicyOptions> configure) { throw null; }
40+
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddStackQueue(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action<Microsoft.AspNetCore.ConcurrencyLimiter.QueuePolicyOptions> configure) { throw null; }
41+
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddTailDropQueue(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action<Microsoft.AspNetCore.ConcurrencyLimiter.QueuePolicyOptions> configure) { throw null; }
4242
}
4343
}

src/Middleware/RequestThrottling/sample/RequestThrottlingSample.csproj renamed to src/Middleware/ConcurrencyLimiter/sample/ConcurrencyLimiterSample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
<ItemGroup Condition="'$(BenchmarksTargetFramework)' == ''">
88
<Reference Include="Microsoft.Extensions.Logging.Console" />
9-
<Reference Include="Microsoft.AspNetCore.RequestThrottling" />
9+
<Reference Include="Microsoft.AspNetCore.ConcurrencyLimiter" />
1010
<Reference Include="Microsoft.AspNetCore.Server.Kestrel" />
1111
<Reference Include="Microsoft.Extensions.Configuration.CommandLine" />
1212
</ItemGroup>
1313

1414
<ItemGroup Condition="'$(BenchmarksTargetFramework)' != ''">
15-
<PackageReference Include="Microsoft.AspNetCore.RequestThrottling" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
15+
<PackageReference Include="Microsoft.AspNetCore.ConcurrencyLimiter" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
1616

1717
<FrameworkReference Update="Microsoft.AspNetCore.App" RuntimeFrameworkVersion="$(MicrosoftAspNetCoreAppPackageVersion)" />
1818
<FrameworkReference Update="Microsoft.NETCore.App" RuntimeFrameworkVersion="$(MicrosoftNETCoreAppPackageVersion)" />
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System;
5+
using System.IO;
6+
using System.Threading.Tasks;
7+
using Microsoft.AspNetCore.Builder;
8+
using Microsoft.AspNetCore.Hosting;
9+
using Microsoft.AspNetCore.Http;
10+
using Microsoft.Extensions.DependencyInjection;
11+
using Microsoft.Extensions.Hosting;
12+
using Microsoft.Extensions.Logging;
13+
14+
namespace ConcurrencyLimiterSample
15+
{
16+
public class Startup
17+
{
18+
public void ConfigureServices(IServiceCollection services)
19+
{
20+
services.AddStackQueue((options) => {
21+
options.MaxConcurrentRequests = Environment.ProcessorCount;
22+
options.RequestQueueLimit = 50;
23+
});
24+
}
25+
26+
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
27+
{
28+
app.UseConcurrencyLimiter();
29+
app.Run(async context =>
30+
{
31+
var delay = 100;
32+
Task.Delay(delay).Wait();
33+
34+
await context.Response.WriteAsync("Hello World!");
35+
});
36+
}
37+
38+
public static void Main(string[] args)
39+
{
40+
new WebHostBuilder()
41+
.UseKestrel()
42+
.UseStartup<Startup>()
43+
.Build()
44+
.Run();
45+
}
46+
}
47+
}

src/Middleware/RequestThrottling/src/RequestThrottlingEventSource.cs renamed to src/Middleware/ConcurrencyLimiter/src/ConcurrencyLimiterEventSource.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
using System.Threading;
99
using Microsoft.Extensions.Internal;
1010

11-
namespace Microsoft.AspNetCore.RequestThrottling
11+
namespace Microsoft.AspNetCore.ConcurrencyLimiter
1212
{
13-
internal sealed class RequestThrottlingEventSource : EventSource
13+
internal sealed class ConcurrencyLimiterEventSource : EventSource
1414
{
15-
public static readonly RequestThrottlingEventSource Log = new RequestThrottlingEventSource();
15+
public static readonly ConcurrencyLimiterEventSource Log = new ConcurrencyLimiterEventSource();
1616
private static readonly QueueFrame CachedNonTimerResult = new QueueFrame(timer: null, parent: Log);
1717

1818
private PollingCounter _rejectedRequestsCounter;
@@ -22,13 +22,13 @@ internal sealed class RequestThrottlingEventSource : EventSource
2222
private long _rejectedRequests;
2323
private int _queueLength;
2424

25-
internal RequestThrottlingEventSource()
26-
: base("Microsoft.AspNetCore.RequestThrottling")
25+
internal ConcurrencyLimiterEventSource()
26+
: base("Microsoft.AspNetCore.ConcurrencyLimiter")
2727
{
2828
}
2929

3030
// Used for testing
31-
internal RequestThrottlingEventSource(string eventSourceName)
31+
internal ConcurrencyLimiterEventSource(string eventSourceName)
3232
: base(eventSourceName)
3333
{
3434
}
@@ -65,9 +65,9 @@ public QueueFrame QueueTimer()
6565
internal struct QueueFrame : IDisposable
6666
{
6767
private ValueStopwatch? _timer;
68-
private RequestThrottlingEventSource _parent;
68+
private ConcurrencyLimiterEventSource _parent;
6969

70-
public QueueFrame(ValueStopwatch? timer, RequestThrottlingEventSource parent)
70+
public QueueFrame(ValueStopwatch? timer, ConcurrencyLimiterEventSource parent)
7171
{
7272
_timer = timer;
7373
_parent = parent;

src/Middleware/RequestThrottling/src/RequestThrottlingExtensions.cs renamed to src/Middleware/ConcurrencyLimiter/src/ConcurrencyLimiterExtensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5-
using Microsoft.AspNetCore.RequestThrottling;
5+
using Microsoft.AspNetCore.ConcurrencyLimiter;
66

77
namespace Microsoft.AspNetCore.Builder
88
{
99
/// <summary>
10-
/// Extension methods for adding the <see cref="RequestThrottlingMiddleware"/> to an application.
10+
/// Extension methods for adding the <see cref="ConcurrencyLimiterMiddleware"/> to an application.
1111
/// </summary>
12-
public static class RequestThrottlingExtensions
12+
public static class ConcurrencyLimiterExtensions
1313
{
1414
/// <summary>
15-
/// Adds the <see cref="RequestThrottlingMiddleware"/> to limit the number of concurrently-executing requests.
15+
/// Adds the <see cref="ConcurrencyLimiterMiddleware"/> to limit the number of concurrently-executing requests.
1616
/// </summary>
1717
/// <param name="app">The <see cref="IApplicationBuilder"/>.</param>
1818
/// <returns>The <see cref="IApplicationBuilder"/>.</returns>
19-
public static IApplicationBuilder UseRequestThrottling(this IApplicationBuilder app)
19+
public static IApplicationBuilder UseConcurrencyLimiter(this IApplicationBuilder app)
2020
{
2121
if (app == null)
2222
{
2323
throw new ArgumentNullException(nameof(app));
2424
}
2525

26-
return app.UseMiddleware<RequestThrottlingMiddleware>();
26+
return app.UseMiddleware<ConcurrencyLimiterMiddleware>();
2727
}
2828
}
2929
}

0 commit comments

Comments
 (0)