2 types derived from ResourceCounter
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Internal\Infrastructure\ResourceCounter.cs (2)
16
private sealed class UnlimitedCounter :
ResourceCounter
24
internal sealed class FiniteCounter :
ResourceCounter
14 references to ResourceCounter
Microsoft.AspNetCore.Server.Kestrel.Core (12)
Internal\Infrastructure\ConnectionManager.cs (5)
22
public ConnectionManager(KestrelTrace trace,
ResourceCounter
upgradedConnections)
34
public
ResourceCounter
UpgradedConnectionCount { get; }
89
private static
ResourceCounter
GetCounter(long? number)
91
?
ResourceCounter
.Quota(number.Value)
92
:
ResourceCounter
.Unlimited;
Internal\Infrastructure\ResourceCounter.cs (2)
13
public static
ResourceCounter
Unlimited { get; } = new UnlimitedCounter();
14
public static
ResourceCounter
Quota(long amount) => new FiniteCounter(amount);
Middleware\ConnectionLimitMiddleware.cs (5)
14
private readonly
ResourceCounter
_concurrentConnectionCounter;
19
: this(next,
ResourceCounter
.Quota(connectionLimit), trace, metrics)
24
internal ConnectionLimitMiddleware(Func<T, Task> next,
ResourceCounter
concurrentConnectionCounter, KestrelTrace trace, KestrelMetrics metrics)
58
private readonly
ResourceCounter
_concurrentConnectionCounter;
61
public ConnectionReleasor(
ResourceCounter
normalConnectionCounter)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
ResourceCounterTests.cs (2)
24
var
counter = ResourceCounter.Quota(1);
36
var
counter = ResourceCounter.Quota(max);