-
Notifications
You must be signed in to change notification settings - Fork 16
ThrottlingBehaviour
ikopylov edited this page Dec 26, 2014
·
1 revision
ThrottlingBehaviour is a primitive responsible for regulating the rate at which application processing is conducted.
ThrottleBehavior sample:
ThrottleBehavior throttler = new ThrottleBehavior(maxRequestPerSecond: 100);
if (throttler.AddHit())
{
//do work
Console.WriteLine("hit ok");
}
CPUThrottleBehavior - ThrottleBehavior that call Sleep when execution quota is exceeded.
CPUThrottleBehavior sample:
CPUThrottleBehavior cpuThrottler = new CPUThrottleBehavior(maxRequestPerSecond: 100);
while (true)
{
if (cpuThrottler.AddHit())
{
Console.WriteLine("hit registered");
}
}