C# Class Nandaka.Common.LimitedConcurrencyLevelTaskScheduler

Provides a task scheduler that ensures a maximum concurrency level while running on top of the thread pool. http://msdn.microsoft.com/en-us/library/ee789351(v=vs.110).aspx
Inheritance: System.Threading.Tasks.TaskScheduler
Show file Open project: Nandaka/NijieDownloader Class Usage Examples

Public Methods

Method Description
LimitedConcurrencyLevelTaskScheduler ( int maxDegreeOfParallelism, int hardLimit ) : System

Protected Methods

Method Description
GetScheduledTasks ( ) : IEnumerable
QueueTask ( Task task ) : void
TryDequeue ( Task task ) : bool
TryExecuteTaskInline ( Task task, bool taskWasPreviouslyQueued ) : bool

Private Methods

Method Description
NotifyThreadPoolOfPendingWork ( ) : void

Method Details

GetScheduledTasks() protected final method

protected final GetScheduledTasks ( ) : IEnumerable
return IEnumerable

LimitedConcurrencyLevelTaskScheduler() public method

public LimitedConcurrencyLevelTaskScheduler ( int maxDegreeOfParallelism, int hardLimit ) : System
maxDegreeOfParallelism int
hardLimit int
return System

QueueTask() protected final method

protected final QueueTask ( Task task ) : void
task Task
return void

TryDequeue() protected final method

protected final TryDequeue ( Task task ) : bool
task Task
return bool

TryExecuteTaskInline() protected final method

protected final TryExecuteTaskInline ( Task task, bool taskWasPreviouslyQueued ) : bool
task Task
taskWasPreviouslyQueued bool
return bool