Class TaskQueue
A queue of tasks, which can be run in FIFO order.
Inheritance
Implements
Inherited Members
Namespace: Moth.Tasks
Assembly: Moth.Tasks.dll
Syntax
public class TaskQueue : IDisposable
Constructors
| Improve this Doc View SourceTaskQueue()
Initializes a new instance of the TaskQueue class.
Declaration
public TaskQueue()
Properties
| Improve this Doc View SourceCount
The number of tasks currently enqueued.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceClear(Action<Exception>)
Removes all pending tasks from the queue. Also calls System.IDisposable.Dispose() on tasks which implement the method.
Declaration
public void Clear(Action<Exception> exceptionHandler = null)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.Exception> | exceptionHandler | Method for handling an exception thrown by a task's System.IDisposable.Dispose(). |
Remarks
As the method iterates through all tasks in the queue and calls System.IDisposable.Dispose() on tasks, it can hang for an unknown amount of time. If an exception is thrown in an System.IDisposable.Dispose() call, the method continues on with disposing the remaining tasks.
Dispose()
Disposes all tasks which implements System.IDisposable.
Declaration
public void Dispose()
Remarks
As the method iterates through all tasks in the queue and calls System.IDisposable.Dispose() on tasks, it can hang for an unknown amount of time. If an exception is thrown in an System.IDisposable.Dispose() call, the method continues on with disposing the remaining tasks.
Dispose(Boolean)
Disposes all tasks which implements System.IDisposable.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | true if called from Dispose(), false if called from finalizer. |
Remarks
As the method iterates through all tasks in the queue and calls System.IDisposable.Dispose() on tasks, it can hang for an unknown amount of time. If an exception is thrown in an System.IDisposable.Dispose() call, the method continues on with disposing the remaining tasks.
Enqueue(Action)
Enqueue an action to be run later.
Declaration
public void Enqueue(Action action)
Parameters
Type | Name | Description |
---|---|---|
System.Action | action | Action to enqueue. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T>(in T)
Enqueue an ITask to be run later.
Declaration
public void Enqueue<T>(in T task)
where T : struct, ITask
Parameters
Type | Name | Description |
---|---|---|
T | task | Task data. |
Type Parameters
Name | Description |
---|---|
T | Type of task to run. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T>(in T, out TaskHandle)
Enqueue an ITask to be run later, giving out a TaskHandle for checking task status.
Declaration
public void Enqueue<T>(in T task, out TaskHandle handle)
where T : struct, ITask
Parameters
Type | Name | Description |
---|---|---|
T | task | Task data. |
TaskHandle | handle | Handle for checking task status. |
Type Parameters
Name | Description |
---|---|
T | Type of task to run. |
Exceptions
Type | Condition |
---|---|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1>(Action<T1>, T1)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1>(Action<T1> action, T1 arg1)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
T2 | arg2 | The 2nd argument to run |
T3 | arg3 | The 3rd argument to run |
T4 | arg4 | The 4th argument to run |
T5 | arg5 | The 5th argument to run |
T6 | arg6 | The 6th argument to run |
T7 | arg7 | The 7th argument to run |
T8 | arg8 | The 8th argument to run |
T9 | arg9 | The 9th argument to run |
T10 | arg10 | The 10th argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
T2 | The type of the 2nd parameter of |
T3 | The type of the 3rd parameter of |
T4 | The type of the 4th parameter of |
T5 | The type of the 5th parameter of |
T6 | The type of the 6th parameter of |
T7 | The type of the 7th parameter of |
T8 | The type of the 8th parameter of |
T9 | The type of the 9th parameter of |
T10 | The type of the 10th parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
T2 | arg2 | The 2nd argument to run |
T3 | arg3 | The 3rd argument to run |
T4 | arg4 | The 4th argument to run |
T5 | arg5 | The 5th argument to run |
T6 | arg6 | The 6th argument to run |
T7 | arg7 | The 7th argument to run |
T8 | arg8 | The 8th argument to run |
T9 | arg9 | The 9th argument to run |
T10 | arg10 | The 10th argument to run |
T11 | arg11 | The 11th argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
T2 | The type of the 2nd parameter of |
T3 | The type of the 3rd parameter of |
T4 | The type of the 4th parameter of |
T5 | The type of the 5th parameter of |
T6 | The type of the 6th parameter of |
T7 | The type of the 7th parameter of |
T8 | The type of the 8th parameter of |
T9 | The type of the 9th parameter of |
T10 | The type of the 10th parameter of |
T11 | The type of the 11th parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
T2 | arg2 | The 2nd argument to run |
T3 | arg3 | The 3rd argument to run |
T4 | arg4 | The 4th argument to run |
T5 | arg5 | The 5th argument to run |
T6 | arg6 | The 6th argument to run |
T7 | arg7 | The 7th argument to run |
T8 | arg8 | The 8th argument to run |
T9 | arg9 | The 9th argument to run |
T10 | arg10 | The 10th argument to run |
T11 | arg11 | The 11th argument to run |
T12 | arg12 | The 12th argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
T2 | The type of the 2nd parameter of |
T3 | The type of the 3rd parameter of |
T4 | The type of the 4th parameter of |
T5 | The type of the 5th parameter of |
T6 | The type of the 6th parameter of |
T7 | The type of the 7th parameter of |
T8 | The type of the 8th parameter of |
T9 | The type of the 9th parameter of |
T10 | The type of the 10th parameter of |
T11 | The type of the 11th parameter of |
T12 | The type of the 12th parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
T2 | arg2 | The 2nd argument to run |
T3 | arg3 | The 3rd argument to run |
T4 | arg4 | The 4th argument to run |
T5 | arg5 | The 5th argument to run |
T6 | arg6 | The 6th argument to run |
T7 | arg7 | The 7th argument to run |
T8 | arg8 | The 8th argument to run |
T9 | arg9 | The 9th argument to run |
T10 | arg10 | The 10th argument to run |
T11 | arg11 | The 11th argument to run |
T12 | arg12 | The 12th argument to run |
T13 | arg13 | The 13th argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
T2 | The type of the 2nd parameter of |
T3 | The type of the 3rd parameter of |
T4 | The type of the 4th parameter of |
T5 | The type of the 5th parameter of |
T6 | The type of the 6th parameter of |
T7 | The type of the 7th parameter of |
T8 | The type of the 8th parameter of |
T9 | The type of the 9th parameter of |
T10 | The type of the 10th parameter of |
T11 | The type of the 11th parameter of |
T12 | The type of the 12th parameter of |
T13 | The type of the 13th parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
T2 | arg2 | The 2nd argument to run |
T3 | arg3 | The 3rd argument to run |
T4 | arg4 | The 4th argument to run |
T5 | arg5 | The 5th argument to run |
T6 | arg6 | The 6th argument to run |
T7 | arg7 | The 7th argument to run |
T8 | arg8 | The 8th argument to run |
T9 | arg9 | The 9th argument to run |
T10 | arg10 | The 10th argument to run |
T11 | arg11 | The 11th argument to run |
T12 | arg12 | The 12th argument to run |
T13 | arg13 | The 13th argument to run |
T14 | arg14 | The 14th argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
T2 | The type of the 2nd parameter of |
T3 | The type of the 3rd parameter of |
T4 | The type of the 4th parameter of |
T5 | The type of the 5th parameter of |
T6 | The type of the 6th parameter of |
T7 | The type of the 7th parameter of |
T8 | The type of the 8th parameter of |
T9 | The type of the 9th parameter of |
T10 | The type of the 10th parameter of |
T11 | The type of the 11th parameter of |
T12 | The type of the 12th parameter of |
T13 | The type of the 13th parameter of |
T14 | The type of the 14th parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
T2 | arg2 | The 2nd argument to run |
T3 | arg3 | The 3rd argument to run |
T4 | arg4 | The 4th argument to run |
T5 | arg5 | The 5th argument to run |
T6 | arg6 | The 6th argument to run |
T7 | arg7 | The 7th argument to run |
T8 | arg8 | The 8th argument to run |
T9 | arg9 | The 9th argument to run |
T10 | arg10 | The 10th argument to run |
T11 | arg11 | The 11th argument to run |
T12 | arg12 | The 12th argument to run |
T13 | arg13 | The 13th argument to run |
T14 | arg14 | The 14th argument to run |
T15 | arg15 | The 15th argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
T2 | The type of the 2nd parameter of |
T3 | The type of the 3rd parameter of |
T4 | The type of the 4th parameter of |
T5 | The type of the 5th parameter of |
T6 | The type of the 6th parameter of |
T7 | The type of the 7th parameter of |
T8 | The type of the 8th parameter of |
T9 | The type of the 9th parameter of |
T10 | The type of the 10th parameter of |
T11 | The type of the 11th parameter of |
T12 | The type of the 12th parameter of |
T13 | The type of the 13th parameter of |
T14 | The type of the 14th parameter of |
T15 | The type of the 15th parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
T2 | arg2 | The 2nd argument to run |
T3 | arg3 | The 3rd argument to run |
T4 | arg4 | The 4th argument to run |
T5 | arg5 | The 5th argument to run |
T6 | arg6 | The 6th argument to run |
T7 | arg7 | The 7th argument to run |
T8 | arg8 | The 8th argument to run |
T9 | arg9 | The 9th argument to run |
T10 | arg10 | The 10th argument to run |
T11 | arg11 | The 11th argument to run |
T12 | arg12 | The 12th argument to run |
T13 | arg13 | The 13th argument to run |
T14 | arg14 | The 14th argument to run |
T15 | arg15 | The 15th argument to run |
T16 | arg16 | The 16th argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
T2 | The type of the 2nd parameter of |
T3 | The type of the 3rd parameter of |
T4 | The type of the 4th parameter of |
T5 | The type of the 5th parameter of |
T6 | The type of the 6th parameter of |
T7 | The type of the 7th parameter of |
T8 | The type of the 8th parameter of |
T9 | The type of the 9th parameter of |
T10 | The type of the 10th parameter of |
T11 | The type of the 11th parameter of |
T12 | The type of the 12th parameter of |
T13 | The type of the 13th parameter of |
T14 | The type of the 14th parameter of |
T15 | The type of the 15th parameter of |
T16 | The type of the 16th parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1, T2>(Action<T1, T2>, T1, T2)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1, T2>(Action<T1, T2> action, T1 arg1, T2 arg2)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
T2 | arg2 | The 2nd argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
T2 | The type of the 2nd parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1, T2, T3>(Action<T1, T2, T3>, T1, T2, T3)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1, T2, T3>(Action<T1, T2, T3> action, T1 arg1, T2 arg2, T3 arg3)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
T2 | arg2 | The 2nd argument to run |
T3 | arg3 | The 3rd argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
T2 | The type of the 2nd parameter of |
T3 | The type of the 3rd parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1, T2, T3, T4>(Action<T1, T2, T3, T4>, T1, T2, T3, T4)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1, T2, T3, T4>(Action<T1, T2, T3, T4> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
T2 | arg2 | The 2nd argument to run |
T3 | arg3 | The 3rd argument to run |
T4 | arg4 | The 4th argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
T2 | The type of the 2nd parameter of |
T3 | The type of the 3rd parameter of |
T4 | The type of the 4th parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1, T2, T3, T4, T5>(Action<T1, T2, T3, T4, T5>, T1, T2, T3, T4, T5)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1, T2, T3, T4, T5>(Action<T1, T2, T3, T4, T5> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
T2 | arg2 | The 2nd argument to run |
T3 | arg3 | The 3rd argument to run |
T4 | arg4 | The 4th argument to run |
T5 | arg5 | The 5th argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
T2 | The type of the 2nd parameter of |
T3 | The type of the 3rd parameter of |
T4 | The type of the 4th parameter of |
T5 | The type of the 5th parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1, T2, T3, T4, T5, T6>(Action<T1, T2, T3, T4, T5, T6>, T1, T2, T3, T4, T5, T6)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1, T2, T3, T4, T5, T6>(Action<T1, T2, T3, T4, T5, T6> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
T2 | arg2 | The 2nd argument to run |
T3 | arg3 | The 3rd argument to run |
T4 | arg4 | The 4th argument to run |
T5 | arg5 | The 5th argument to run |
T6 | arg6 | The 6th argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
T2 | The type of the 2nd parameter of |
T3 | The type of the 3rd parameter of |
T4 | The type of the 4th parameter of |
T5 | The type of the 5th parameter of |
T6 | The type of the 6th parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1, T2, T3, T4, T5, T6, T7>(Action<T1, T2, T3, T4, T5, T6, T7>, T1, T2, T3, T4, T5, T6, T7)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1, T2, T3, T4, T5, T6, T7>(Action<T1, T2, T3, T4, T5, T6, T7> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6, T7> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
T2 | arg2 | The 2nd argument to run |
T3 | arg3 | The 3rd argument to run |
T4 | arg4 | The 4th argument to run |
T5 | arg5 | The 5th argument to run |
T6 | arg6 | The 6th argument to run |
T7 | arg7 | The 7th argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
T2 | The type of the 2nd parameter of |
T3 | The type of the 3rd parameter of |
T4 | The type of the 4th parameter of |
T5 | The type of the 5th parameter of |
T6 | The type of the 6th parameter of |
T7 | The type of the 7th parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1, T2, T3, T4, T5, T6, T7, T8>(Action<T1, T2, T3, T4, T5, T6, T7, T8>, T1, T2, T3, T4, T5, T6, T7, T8)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1, T2, T3, T4, T5, T6, T7, T8>(Action<T1, T2, T3, T4, T5, T6, T7, T8> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6, T7, T8> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
T2 | arg2 | The 2nd argument to run |
T3 | arg3 | The 3rd argument to run |
T4 | arg4 | The 4th argument to run |
T5 | arg5 | The 5th argument to run |
T6 | arg6 | The 6th argument to run |
T7 | arg7 | The 7th argument to run |
T8 | arg8 | The 8th argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
T2 | The type of the 2nd parameter of |
T3 | The type of the 3rd parameter of |
T4 | The type of the 4th parameter of |
T5 | The type of the 5th parameter of |
T6 | The type of the 6th parameter of |
T7 | The type of the 7th parameter of |
T8 | The type of the 8th parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>, T1, T2, T3, T4, T5, T6, T7, T8, T9)
Enqueue an action to be run later with supplied arguments.
Declaration
public void Enqueue<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9> action, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5, T6, T7, T8, T9> | action | Action to enqueue. |
T1 | arg1 | The 1st argument to run |
T2 | arg2 | The 2nd argument to run |
T3 | arg3 | The 3rd argument to run |
T4 | arg4 | The 4th argument to run |
T5 | arg5 | The 5th argument to run |
T6 | arg6 | The 6th argument to run |
T7 | arg7 | The 7th argument to run |
T8 | arg8 | The 8th argument to run |
T9 | arg9 | The 9th argument to run |
Type Parameters
Name | Description |
---|---|
T1 | The type of the 1st parameter of |
T2 | The type of the 2nd parameter of |
T3 | The type of the 3rd parameter of |
T4 | The type of the 4th parameter of |
T5 | The type of the 5th parameter of |
T6 | The type of the 6th parameter of |
T7 | The type of the 7th parameter of |
T8 | The type of the 8th parameter of |
T9 | The type of the 9th parameter of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ObjectDisposedException | The TaskQueue has been disposed. |
Finalize()
Finalizes an instance of the TaskQueue class. Also disposes of tasks implementing System.IDisposable.Dispose().
Declaration
protected void Finalize()
RunNextTask(IProfiler, CancellationToken)
Blocks until a task is ready in the queue, then runs it.
Declaration
public void RunNextTask(IProfiler profiler = null, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IProfiler | profiler | IProfiler to profile the run-time of the task. |
System.Threading.CancellationToken | token | A System.Threading.CancellationToken to observe when waiting for a task. Does not cancel actual task execution. |
RunNextTask(out Exception, IProfiler, CancellationToken)
Blocks until a task is ready in the queue, then runs it.
Declaration
public void RunNextTask(out Exception exception, IProfiler profiler = null, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Exception | exception | System.Exception thrown if task failed. Is null if task was run successfully. |
IProfiler | profiler | IProfiler to profile the run-time of the task. |
System.Threading.CancellationToken | token | A System.Threading.CancellationToken to observe when waiting for a task. Does not cancel actual task execution. |
TryRunNextTask(IProfiler)
Tries to run the next task in the queue, if present. May also perform profiling on the task through an IProfiler.
Declaration
public bool TryRunNextTask(IProfiler profiler = null)
Parameters
Type | Name | Description |
---|---|---|
IProfiler | profiler | IProfiler to profile the run-time of the task. |
Returns
Type | Description |
---|---|
System.Boolean | true if a task was run, false if the TaskQueue is empty. |
Remarks
Please note that the return value does not indicate if a task was successful. The method will return true if a task was ready in the queue, regardless of whether an exception occured.
TryRunNextTask(out Exception, IProfiler)
Tries to run the next task in the queue, if present. Provides an System.Exception thrown by the task, in case it fails. May also perform profiling on the task through an IProfiler.
Declaration
public bool TryRunNextTask(out Exception exception, IProfiler profiler = null)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | exception | System.Exception thrown if task failed. Is null if task was run successfully. |
IProfiler | profiler | IProfiler to profile the run-time of the task. |
Returns
Type | Description |
---|---|
System.Boolean | true if a task was run, false if the TaskQueue is empty. |
Remarks
Please note that the return value does not indicate if a task was successful. The method will return true if a task was ready in the queue, regardless of whether an exception occured.