C# Class DotNetWorkQueue.TaskScheduling.SchedulerTaskFactory

Extends the standard task factory to allow for trying to add a new task, but failing to do so.
Inheritance: ITaskFactory
Show file Open project: blehnen/DotNetWorkQueue

Public Methods

Method Description
SchedulerTaskFactory ( ITaskSchedulerFactory schedulerFactory ) : System

Initializes a new instance of the SchedulerTaskFactory class.

TryStartNew ( Action action, StateInformation state, Action continueWith, System.Threading.Tasks.Task &task ) : TryStartNewResult

Tries to add a new task to the task factory

The factory may reject the request if it's too busy.

Private Methods

Method Description
SchedulerHasRoom ( StateInformation state ) : bool

Returns true if the scheduler has room for another task

Method Details

SchedulerTaskFactory() public method

Initializes a new instance of the SchedulerTaskFactory class.
public SchedulerTaskFactory ( ITaskSchedulerFactory schedulerFactory ) : System
schedulerFactory ITaskSchedulerFactory The scheduler factory.
return System

TryStartNew() public method

Tries to add a new task to the task factory
The factory may reject the request if it's too busy.
public TryStartNew ( Action action, StateInformation state, Action continueWith, System.Threading.Tasks.Task &task ) : TryStartNewResult
action Action The action.
state StateInformation The state.
continueWith Action The continue with action.
task System.Threading.Tasks.Task The task.
return TryStartNewResult