Class OperationQueueExtensions
- Namespace
- Punchclock
- Assembly
- Punchclock.dll
Extension methods associated with the Operation
- Inheritance
-
Operation
Queue Extensions
Methods
Enqueue(OperationQueue, int, Func<Task>)
Adds a operation to the operation queue.
public static Task Enqueue(this OperationQueue operationQueue, int priority, Func<Task> asyncOperation)
Parameters
operationQueue
OperationQueue The operation queue to add our operation to.
priority
intThe priority of operation. Higher priorities run before lower ones.
asyncOperation
Func<Task>The async method to execute when scheduled.
Returns
- Task
A task to monitor the progress.
Enqueue(OperationQueue, int, string, Func<Task>)
Adds a operation to the operation queue.
public static Task Enqueue(this OperationQueue operationQueue, int priority, string key, Func<Task> asyncOperation)
Parameters
operationQueue
OperationQueue The operation queue to add our operation to.
priority
intThe priority of operation. Higher priorities run before lower ones.
key
stringA key to apply to the operation. Items with the same key will be run in order.
asyncOperation
Func<Task>The async method to execute when scheduled.
Returns
- Task
A task to monitor the progress.
Enqueue(OperationQueue, int, string, Func<Task>, CancellationToken)
Adds a operation to the operation queue.
public static Task Enqueue(this OperationQueue operationQueue, int priority, string key, Func<Task> asyncOperation, CancellationToken token)
Parameters
operationQueue
OperationQueue The operation queue to add our operation to.
priority
intThe priority of operation. Higher priorities run before lower ones.
key
stringA key to apply to the operation. Items with the same key will be run in order.
asyncOperation
Func<Task>The async method to execute when scheduled.
token
CancellationToken A cancellation token which if signalled, the operation will be cancelled.
Returns
- Task
A task to monitor the progress.
Enqueue<T>(OperationQueue, int, Func<Task<T>>)
Adds a operation to the operation queue.
public static Task<T> Enqueue<T>(this OperationQueue operationQueue, int priority, Func<Task<T>> asyncOperation)
Parameters
operationQueue
OperationQueue The operation queue to add our operation to.
priority
intThe priority of operation. Higher priorities run before lower ones.
asyncOperation
Func<Task<T>>The async method to execute when scheduled.
Returns
- Task<T>
A task to monitor the progress.
Type Parameters
T
The type of item contained within our observable.
Enqueue<T>(OperationQueue, int, string, Func<Task<T>>)
Adds a operation to the operation queue.
public static Task<T> Enqueue<T>(this OperationQueue operationQueue, int priority, string key, Func<Task<T>> asyncOperation)
Parameters
operationQueue
OperationQueue The operation queue to add our operation to.
priority
intThe priority of operation. Higher priorities run before lower ones.
key
stringA key to apply to the operation. Items with the same key will be run in order.
asyncOperation
Func<Task<T>>The async method to execute when scheduled.
Returns
- Task<T>
A task to monitor the progress.
Type Parameters
T
The type of item contained within our observable.
Enqueue<T>(OperationQueue, int, string, Func<Task<T>>, CancellationToken)
Adds a operation to the operation queue.
public static Task<T> Enqueue<T>(this OperationQueue operationQueue, int priority, string key, Func<Task<T>> asyncOperation, CancellationToken token)
Parameters
operationQueue
OperationQueue The operation queue to add our operation to.
priority
intThe priority of operation. Higher priorities run before lower ones.
key
stringA key to apply to the operation. Items with the same key will be run in order.
asyncOperation
Func<Task<T>>The async method to execute when scheduled.
token
CancellationToken A cancellation token which if signalled, the operation will be cancelled.
Returns
- Task<T>
A task to monitor the progress.
Type Parameters
T
The type of item contained within our observable.