-
Notifications
You must be signed in to change notification settings - Fork 528
Rename min rate APIs for consistency #1901
Comments
@Eilon @DamianEdwards @shirhatti FYI -- proposed breaking change between preview2 and RTM to make the names more consistent. |
Can someone show the full list of before/after values? Hard to tell what's consistent etc. |
@CesarBS could you make a table? |
KestrelServerLimits
Features
MinimumDataRateBeforepublic class MinimumDataRate
{
public MinimumDataRate(double rate, TimeSpan gracePeriod)
{
...
}
public double Rate { get; }
public TimeSpan GracePeriod { get; }
} Afterpublic class MinimumDataRate
{
public MinimumDataRate(double bytesPerSecond, TimeSpan gracePeriod)
{
...
}
public double BytesPerSecond { get; }
public TimeSpan GracePeriod { get; }
} |
I suggest we also look at Could either move E.g. current default setting: using Microsoft.AspNetCore.Server.Kestrel.Core.Features;
var dataRate = new MinimumDataRate(rate: 100, gracePeriod: TimeSpan.FromSeconds(2));
limits.RequestBodyMinimumDataRate = dataRate; Proposed new default setting, second alternative: limits.RequestBodyMinimumDataRate.BytesPerSecond = 100;
// Perhaps optional. Would probably need a reasonable default for `GracePeriod` anyway.
limits.RequestBodyMinimumDataRate.GracePeriod = TimeSpan.FromSeconds(2); |
When we had the discussion about having a But now that it's just the rate, we should remove |
Should also make |
I'm not sure we need to worry much about how many namespaces are imported for a very obscure server feature. The importance of this feature is that it exists and has smart defaults. For the few people in the world who would override the defaults, I'm not concerned how many namespace they import. VS will add the namespace for you anyway. Or, just make it a Having said all that, I think the new suggested names in general are fine. I'd like @DamianEdwards / @davidfowl / @blowdart to share any thoughts they have on those before committing to anything. |
I'm good with the naming changes. |
…#1901). - IHttpRequestBodyMinimumDataRateFeature -> IHttpMinRequestBodyDataRateFeature - KestrelServerLimits.RequestBodyMinimumDataRate -> MinRequestBodyDataRate - Also rename "rate" param and property of MinimumDataRate to "bytesPerSecond"
…#1901). - IHttpRequestBodyMinimumDataRateFeature -> IHttpMinRequestBodyDataRateFeature - KestrelServerLimits.RequestBodyMinimumDataRate -> MinRequestBodyDataRate - Also rename "rate" param and property of MinimumDataRate to "bytesPerSecond"
…#1901). - IHttpRequestBodyMinimumDataRateFeature -> IHttpMinRequestBodyDataRateFeature - KestrelServerLimits.RequestBodyMinimumDataRate -> MinRequestBodyDataRate - Also rename "rate" param and property of MinimumDataRate to "bytesPerSecond"
…#1901). - IHttpRequestBodyMinimumDataRateFeature -> IHttpMinRequestBodyDataRateFeature - KestrelServerLimits.RequestBodyMinimumDataRate -> MinRequestBodyDataRate - Also rename "rate" param and property of MinimumDataRate to "bytesPerSecond"
We should do this before RTM:
KestrelServerLimits.RequestBodyMinimumDataRate
toMinRequestBodyDataRate
(consistent with MaxRequestBodySize, and other limits that all start with “Max”)IHttpRequestBodyMinimumDataRateFeature
toIHttpMinRequestBodyDataRateFeature
(consistent withIHttpMaxRequestBodySizeFeature
)rate
parameter of theMinimumDataRate
ctor tobytesPerSecond
, so that the rate’s unit of measurement is clearThe text was updated successfully, but these errors were encountered: