Skip to content
Jef King edited this page Jun 27, 2018 · 15 revisions

Use Case

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;
	}
}

Frequency Samples

Exponential Adaptive Task Exponential

Linear Adaptive Task Linear

You can now Auto-Scale your adaptive tasks!

Clone this wiki locally