23.180. Class RunningTaskProcessor

Namespace: ArmoniK.Core.Common.Pollster
Assembly: ArmoniK.Core.Common.dll

A background service that processes running tasks from a queue. It reads task handlers from the running task queue, executes them, and forwards completed tasks to the post-processing queue.

public class RunningTaskProcessor : BackgroundService, IHostedService, IDisposable

23.180.1. Inheritance

objectBackgroundServiceRunningTaskProcessor

23.180.2. Implements

IHostedService, IDisposable

23.180.3. Inherited Members

BackgroundService.Dispose(), BackgroundService.ExecuteAsync(CancellationToken), BackgroundService.StartAsync(CancellationToken), BackgroundService.StopAsync(CancellationToken), BackgroundService.ExecuteTask, object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

23.180.4. Constructors

23.180.4.1. RunningTaskProcessor(RunningTaskQueue, PostProcessingTaskQueue, ExceptionManager, ILogger<RunningTaskProcessor>)

Initializes a new instance of the class.

public RunningTaskProcessor(RunningTaskQueue runningTaskQueue, PostProcessingTaskQueue postProcessingTaskQueue, ExceptionManager exceptionManager, ILogger<RunningTaskProcessor> logger)

23.180.4.1.1. Parameters

runningTaskQueue RunningTaskQueue

The queue containing tasks ready for execution.

postProcessingTaskQueue PostProcessingTaskQueue

The queue where completed tasks are forwarded for post-processing.

exceptionManager ExceptionManager

The manager handling exceptions and cancellation.

logger ILogger<RunningTaskProcessor>

The logger for this class.

23.180.5. Methods

23.180.5.1. ExecuteAsync(CancellationToken)

This method is called when the starts. The implementation should return a task that represents the lifetime of the long running operation(s) being performed.

protected override Task ExecuteAsync(CancellationToken stoppingToken)

23.180.5.1.1. Parameters

stoppingToken CancellationToken

Triggered when is called.

23.180.5.1.2. Returns

Task

A that represents the long running operations.

23.180.5.1.3. Remarks

See Worker Services in .NET for implementation guidelines.