26.39. Class ResultWatcher

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

Implementation of for MongoDB

public class ResultWatcher : IResultWatcher, IInitializable, IHealthCheckProvider

26.39.1. Inheritance

objectResultWatcher

26.39.2. Implements

IResultWatcher, IInitializable, IHealthCheckProvider

26.39.3. Inherited Members

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

26.39.4. Constructors

26.39.4.1. ResultWatcher(SessionProvider, MongoCollectionProvider<Result, ResultDataModelMapping>, ActivitySource, ILogger<ResultWatcher>)

Initializes from the given parameters

public ResultWatcher(SessionProvider sessionProvider, MongoCollectionProvider<Result, ResultDataModelMapping> resultCollectionProvider, ActivitySource activitySource, ILogger<ResultWatcher> logger)

26.39.4.1.1. Parameters

sessionProvider SessionProvider

MongoDB session provider

resultCollectionProvider MongoCollectionProvider<Result, ResultDataModelMapping>

Result collection provider

activitySource ActivitySource

Activity source

logger ILogger<ResultWatcher>

Logger used to produce logs

26.39.5. Methods

26.39.5.1. Check(HealthCheckTag)

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

public Task<HealthCheckResult> Check(HealthCheckTag tag)

26.39.5.1.1. Parameters

tag HealthCheckTag

Health check for which the class has to answer.

26.39.5.1.2. Returns

Task<HealthCheckResult>

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

26.39.5.2. GetNewResults(Expression<Func<Result, bool>>, CancellationToken)

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

public Task<IAsyncEnumerable<NewResult>> GetNewResults(Expression<Func<Result, bool>> filter, CancellationToken cancellationToken = default)

26.39.5.2.1. Parameters

filter Expression<Func<Result, bool>>

Filter expression describing the results events to be returned

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.39.5.2.2. Returns

Task<IAsyncEnumerable<NewResult>>

A that holds the updates when they are available

26.39.5.3. GetResultOwnerUpdates(Expression<Func<Result, bool>>, CancellationToken)

Receive a event when the OwnerId of a result changes in the given session

public Task<IAsyncEnumerable<ResultOwnerUpdate>> GetResultOwnerUpdates(Expression<Func<Result, bool>> filter, CancellationToken cancellationToken = default)

26.39.5.3.1. Parameters

filter Expression<Func<Result, bool>>

Filter expression describing the results events to be returned

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.39.5.3.2. Returns

Task<IAsyncEnumerable<ResultOwnerUpdate>>

A that holds the updates when they are available

26.39.5.4. GetResultStatusUpdates(Expression<Func<Result, bool>>, CancellationToken)

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

public Task<IAsyncEnumerable<ResultStatusUpdate>> GetResultStatusUpdates(Expression<Func<Result, bool>> filter, CancellationToken cancellationToken = default)

26.39.5.4.1. Parameters

filter Expression<Func<Result, bool>>

Filter expression describing the results events to be returned

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.39.5.4.2. Returns

Task<IAsyncEnumerable<ResultStatusUpdate>>

A that holds the updates when they are available

26.39.5.5. Init(CancellationToken)

Executes an initialization process for the class

public Task Init(CancellationToken cancellationToken)

26.39.5.5.1. Parameters

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.39.5.5.2. Returns

Task

Task representing the asynchronous execution of the method