21.267. Class TaskTableExt

Namespace: ArmoniK.Core.Common.gRPC.Convertors
Assembly: ArmoniK.Core.Common.dll

Provides extension methods for the interface to support gRPC operations.

public static class TaskTableExt

21.267.1. Inheritance

objectTaskTableExt

21.267.2. Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

21.267.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.

21.267.4. Methods

21.267.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)

21.267.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

21.267.4.1.2. Returns

Task<int>

The number of cancelled tasks

21.267.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)

21.267.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

21.267.4.2.2. Returns

Task<IEnumerable<TaskStatusCount>>

The number of tasks that matched the filter

21.267.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)

21.267.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

21.267.4.3.2. Returns

IAsyncEnumerable<string>

List of tasks that matched the filter

21.267.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)

21.267.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

21.267.4.4.2. Returns

Task<long>

The number of updated tasks