22.268. Class TaskTableExt
Namespace: ArmoniK.Core.Common.gRPC.Convertors
Assembly: ArmoniK.Core.Common.dll
Provides extension methods for the
public static class TaskTableExt
22.268.1. Inheritance
22.268.2. Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
22.268.3. Remarks
This static class provides methods that bridge between the internal task table operations and the gRPC API, enabling operations like counting, listing, updating, and canceling tasks based on gRPC-based filter criteria.
22.268.4. Methods
22.268.4.1. CancelTasks(ITaskTable, TaskFilter, CancellationToken)
Cancel the tasks matching the given filter
public static Task<int> CancelTasks(this ITaskTable taskTable, TaskFilter filter, CancellationToken cancellationToken = default)
22.268.4.1.1. Parameters
taskTable ITaskTable
Interface to manage tasks lifecycle
filter TaskFilter
Task Filter describing the tasks that should be cancelled
cancellationToken CancellationToken
Token used to cancel the execution of the method
22.268.4.1.2. Returns
The number of cancelled tasks
22.268.4.2. CountTasksAsync(ITaskTable, TaskFilter, CancellationToken)
Count tasks matching a given filter
public static Task<IEnumerable<TaskStatusCount>> CountTasksAsync(this ITaskTable taskTable, TaskFilter filter, CancellationToken cancellationToken = default)
22.268.4.2.1. Parameters
taskTable ITaskTable
Interface to manage tasks lifecycle
filter TaskFilter
Task Filter describing the tasks to be counted
cancellationToken CancellationToken
Token used to cancel the execution of the method
22.268.4.2.2. Returns
Task<IEnumerable<TaskStatusCount>>
The number of tasks that matched the filter
22.268.4.3. ListTasksAsync(ITaskTable, TaskFilter, CancellationToken)
List all tasks matching a given filter
public static IAsyncEnumerable<string> ListTasksAsync(this ITaskTable taskTable, TaskFilter filter, CancellationToken cancellationToken = default)
22.268.4.3.1. Parameters
taskTable ITaskTable
Interface to manage tasks lifecycle
filter TaskFilter
Task Filter describing the tasks to be counted
cancellationToken CancellationToken
Token used to cancel the execution of the method
22.268.4.3.2. Returns
List of tasks that matched the filter
22.268.4.4. UpdateAllTaskStatusAsync(ITaskTable, TaskFilter, TaskStatus, CancellationToken)
Update the statuses of all tasks matching a given filter
public static Task<long> UpdateAllTaskStatusAsync(this ITaskTable taskTable, TaskFilter filter, TaskStatus status, CancellationToken cancellationToken = default)
22.268.4.4.1. Parameters
taskTable ITaskTable
Interface to manage tasks lifecycle
filter TaskFilter
Task Filter describing the tasks whose status should be updated
status TaskStatus
The new task status
cancellationToken CancellationToken
Token used to cancel the execution of the method
22.268.4.4.2. Returns
The number of updated tasks