-
Notifications
You must be signed in to change notification settings - Fork 8
Adaptive
Jef King edited this page Jun 27, 2018
·
15 revisions
The adaptive task increments or decrements frequency one step at a time. When the task is run it returns either true or false which signals to step up or down. This provides scale that slowly gets faster or slower.
class MyTask : AdaptiveTask
{
public override void Run(out bool workWasDone)
{
workWasDone = false;
//Process background work here.
//If work is done
workWasDone = true;
}
}
class MyTask : IDynamicRuns
{
public async Task<bool> Run()
{
//Process background work here.
return true; //If work is done
}
public int MinimumPeriodInSeconds
{
get;
private set;
}
public int MaximumPeriodInSeconds
{
get;
private set;
}
}
Exponential
Linear
You can now Auto-Scale your adaptive tasks!