C# Class Microsoft.Languages.Editor.Tasks.IdleTimeAsyncTaskQueue

A queue of asynchronous tasks that are processed in the order they were added. As opposed to thread pool tasks only start on idle and queued task may be canceled if needed. There may be one or more tasks running in parallel depending on number of CPUs avaialable.
显示文件 Open project: Microsoft/RTVS Class Usage Examples

Public Methods

Method Description
CancelTasks ( object tag ) : void

Removes tasks associated with a give callback

Enqueue ( Func taskAction, Action callbackAction, Action cancelAction, object tag ) : void

Add task to the idle time queue. Tasks are executed asynchronously in the order they were added. On next idle time if thread is available it will take task from the head of the queue and execute it. There may be one or more tasks running in parallel depending on number of CPUs avaialable.

Enqueue ( Func taskAction, Action callbackAction, object tag ) : void

Add task to the idle time queue. Tasks are executed asynchronously in the order they were added. On next idle time if thread is available it will take task from the head of the queue and execute it. There may be one or more tasks running in parallel depending on number of CPUs avaialable.

IdleTimeAsyncTaskQueue ( IEditorShell shell ) : System
IncreasePriority ( object tag ) : void

Private Methods

Method Description
ConnectToIdle ( ) : void
DisconnectFromIdle ( ) : void
GetAvailableTask ( object tag, IdleTimeAsyncTask &worker ) : bool
OnIdle ( object sender, EventArgs e ) : void

Method Details

CancelTasks() public method

Removes tasks associated with a give callback
public CancelTasks ( object tag ) : void
tag object
return void

Enqueue() public method

Add task to the idle time queue. Tasks are executed asynchronously in the order they were added. On next idle time if thread is available it will take task from the head of the queue and execute it. There may be one or more tasks running in parallel depending on number of CPUs avaialable.
public Enqueue ( Func taskAction, Action callbackAction, Action cancelAction, object tag ) : void
taskAction Func
callbackAction Action
cancelAction Action
tag object
return void

Enqueue() public method

Add task to the idle time queue. Tasks are executed asynchronously in the order they were added. On next idle time if thread is available it will take task from the head of the queue and execute it. There may be one or more tasks running in parallel depending on number of CPUs avaialable.
public Enqueue ( Func taskAction, Action callbackAction, object tag ) : void
taskAction Func
callbackAction Action
tag object
return void

IdleTimeAsyncTaskQueue() public method

public IdleTimeAsyncTaskQueue ( IEditorShell shell ) : System
shell IEditorShell
return System

IncreasePriority() public method

public IncreasePriority ( object tag ) : void
tag object
return void