Diffusion .NET Classic API - Core and Common  5.9.4
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
PushTechnology.DiffusionCore.Threading.LimitedConcurrencyLevelTaskScheduler Class Reference

Provides a task scheduler that ensures a maximum concurrency level while running on top of the ThreadPool. More...

Inheritance diagram for PushTechnology.DiffusionCore.Threading.LimitedConcurrencyLevelTaskScheduler:

Public Member Functions

 LimitedConcurrencyLevelTaskScheduler (int maxDegreeOfParallelism)
 Initializes an instance of the LimitedConcurrencyLevelTaskScheduler class with the specified degree of parallelism. More...
 

Protected Member Functions

override sealed void QueueTask (Task task)
 Queues a task to the scheduler. More...
 
override sealed bool TryExecuteTaskInline (Task task, bool taskWasPreviouslyQueued)
 Attempts to execute the specified task on the current thread. More...
 
override sealed bool TryDequeue (Task task)
 Attempts to remove a previously scheduled task from the scheduler. More...
 
override sealed IEnumerable< Task > GetScheduledTasks ()
 Gets an enumerable of the tasks currently scheduled on this scheduler. More...
 

Properties

override sealed int MaximumConcurrencyLevel [get]
 Gets the maximum concurrency level supported by this scheduler. More...
 

Detailed Description

Provides a task scheduler that ensures a maximum concurrency level while running on top of the ThreadPool.

Constructor & Destructor Documentation

PushTechnology.DiffusionCore.Threading.LimitedConcurrencyLevelTaskScheduler.LimitedConcurrencyLevelTaskScheduler ( int  maxDegreeOfParallelism)

Initializes an instance of the LimitedConcurrencyLevelTaskScheduler class with the specified degree of parallelism.

Parameters
maxDegreeOfParallelismThe maximum degree of parallelism provided by this scheduler.

Member Function Documentation

override sealed IEnumerable<Task> PushTechnology.DiffusionCore.Threading.LimitedConcurrencyLevelTaskScheduler.GetScheduledTasks ( )
protected

Gets an enumerable of the tasks currently scheduled on this scheduler.

Returns
An enumerable of the tasks currently scheduled.
override sealed void PushTechnology.DiffusionCore.Threading.LimitedConcurrencyLevelTaskScheduler.QueueTask ( Task  task)
protected

Queues a task to the scheduler.

Parameters
taskThe task to be queued.
override sealed bool PushTechnology.DiffusionCore.Threading.LimitedConcurrencyLevelTaskScheduler.TryDequeue ( Task  task)
protected

Attempts to remove a previously scheduled task from the scheduler.

Parameters
taskThe task to be removed.
Returns
Whether the task could be found and removed.
override sealed bool PushTechnology.DiffusionCore.Threading.LimitedConcurrencyLevelTaskScheduler.TryExecuteTaskInline ( Task  task,
bool  taskWasPreviouslyQueued 
)
protected

Attempts to execute the specified task on the current thread.

Parameters
taskThe task to be executed.
taskWasPreviouslyQueued
Returns
Whether the task could be executed on the current thread.

Property Documentation

override sealed int PushTechnology.DiffusionCore.Threading.LimitedConcurrencyLevelTaskScheduler.MaximumConcurrencyLevel
get

Gets the maximum concurrency level supported by this scheduler.