21.63. Class TaskWatcher

Namespace: ArmoniK.Core.Adapters.MongoDB
Assembly: ArmoniK.Core.Adapters.MongoDB.dll

Implementation of for MongoDB

public class TaskWatcher : ITaskWatcher, IInitializable, IHealthCheckProvider

21.63.1. Inheritance

objectTaskWatcher

21.63.2. Implements

ITaskWatcher, IInitializable, IHealthCheckProvider

21.63.3. Inherited Members

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

21.63.4. Constructors

21.63.4.1. TaskWatcher(SessionProvider, MongoCollectionProvider<TaskData, TaskDataModelMapping>, ActivitySource, ILogger<TaskWatcher>)

Initializes from the given parameters

public TaskWatcher(SessionProvider sessionProvider, MongoCollectionProvider<TaskData, TaskDataModelMapping> taskCollectionProvider, ActivitySource activitySource, ILogger<TaskWatcher> logger)

21.63.4.1.1. Parameters

sessionProvider SessionProvider

MongoDB session provider

taskCollectionProvider MongoCollectionProvider<TaskData, TaskDataModelMapping>

Task collection provider

activitySource ActivitySource

Activity source

logger ILogger<TaskWatcher>

Logger used to produce logs

21.63.5. Methods

21.63.5.1. Check(HealthCheckTag)

Checks the status of a class for the given health check type.

public Task<HealthCheckResult> Check(HealthCheckTag tag)

21.63.5.1.1. Parameters

tag HealthCheckTag

Health check for which the class has to answer.

21.63.5.1.2. Returns

Task<HealthCheckResult>

The result of the check containing the status of the class for the health check type.

21.63.5.2. GetNewTasks(Expression<Func<TaskData, bool>>, CancellationToken)

Receive a event when a new task is added in the given session

public Task<IAsyncEnumerable<NewTask>> GetNewTasks(Expression<Func<TaskData, bool>> filter, CancellationToken cancellationToken = default)

21.63.5.2.1. Parameters

filter Expression<Func<TaskData, bool>>

Filter expression describing the tasks events to be returned

cancellationToken CancellationToken

Token used to cancel the execution of the method

21.63.5.2.2. Returns

Task<IAsyncEnumerable<NewTask>>

A that holds the updates when they are available

21.63.5.3. GetTaskStatusUpdates(Expression<Func<TaskData, bool>>, CancellationToken)

Receive a event when the Status of a task changes in the given session

public Task<IAsyncEnumerable<TaskStatusUpdate>> GetTaskStatusUpdates(Expression<Func<TaskData, bool>> filter, CancellationToken cancellationToken = default)

21.63.5.3.1. Parameters

filter Expression<Func<TaskData, bool>>

Filter expression describing the tasks events to be returned

cancellationToken CancellationToken

Token used to cancel the execution of the method

21.63.5.3.2. Returns

Task<IAsyncEnumerable<TaskStatusUpdate>>

A that holds the updates when they are available

21.63.5.4. Init(CancellationToken)

Executes an initialization process for the class

public Task Init(CancellationToken cancellationToken)

21.63.5.4.1. Parameters

cancellationToken CancellationToken

Token used to cancel the execution of the method

21.63.5.4.2. Returns

Task

Task representing the asynchronous execution of the method