21.176. Class Pollster

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

Controls the polling and processing of tasks from the queue, manages task execution lifecycle, and provides health check capabilities.

public class Pollster : IInitializable, IHealthCheckProvider

21.176.1. Inheritance

objectPollster

21.176.2. Implements

IInitializable, IHealthCheckProvider

21.176.3. Inherited Members

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

21.176.4. Constructors

21.176.4.1. Pollster(IPullQueueStorage, IPushQueueStorage, DataPrefetcher, ComputePlane, Pollster, Submitter, ExceptionManager, ActivitySource, ILogger<Pollster>, ILoggerFactory, IObjectStorage, IResultTable, ISubmitter, ISessionTable, ITaskTable, ITaskProcessingChecker, IWorkerStreamHandler, IAgentHandler, RunningTaskQueue, AgentIdentifier, MeterHolder, HealthCheckRecord)

Initializes a new instance of the class.

public Pollster(IPullQueueStorage pullQueueStorage, IPushQueueStorage pushQueueStorage, DataPrefetcher dataPrefetcher, ComputePlane options, Pollster pollsterOptions, Submitter submitterOptions, ExceptionManager exceptionManager, ActivitySource activitySource, ILogger<Pollster> logger, ILoggerFactory loggerFactory, IObjectStorage objectStorage, IResultTable resultTable, ISubmitter submitter, ISessionTable sessionTable, ITaskTable taskTable, ITaskProcessingChecker taskProcessingChecker, IWorkerStreamHandler workerStreamHandler, IAgentHandler agentHandler, RunningTaskQueue runningTaskQueue, AgentIdentifier identifier, MeterHolder meterHolder, HealthCheckRecord healthCheckRecord)

21.176.4.1.1. Parameters

pullQueueStorage IPullQueueStorage

The storage service for pulling tasks from the queue.

pushQueueStorage IPushQueueStorage

The storage service for pushing tasks into the queue.

dataPrefetcher DataPrefetcher

The service to prefetch data needed for task execution.

options ComputePlane

Configuration options for the compute plane.

pollsterOptions Pollster

Specific options for the pollster behavior.

submitterOptions Submitter

Specific options for the submitter behavior.

exceptionManager ExceptionManager

Manager to handle and record exceptions.

activitySource ActivitySource

Source for activity tracking and tracing.

logger ILogger<Pollster>

Logger for the pollster.

loggerFactory ILoggerFactory

Factory to create loggers for child components.

objectStorage IObjectStorage

Storage for task-related objects.

resultTable IResultTable

Table to store task results.

submitter ISubmitter

Service to submit new tasks.

sessionTable ISessionTable

Table to manage sessions.

taskTable ITaskTable

Table to store and retrieve task information.

taskProcessingChecker ITaskProcessingChecker

Service to check if tasks can be processed.

workerStreamHandler IWorkerStreamHandler

Handler for worker streams.

agentHandler IAgentHandler

Handler for agents.

runningTaskQueue RunningTaskQueue

Queue for running tasks.

identifier AgentIdentifier

Identifier for the agent running the pollster.

meterHolder MeterHolder

Holder for metrics collection.

healthCheckRecord HealthCheckRecord

Record for the health check of the application.

21.176.4.1.2. Exceptions

ArgumentOutOfRangeException

Thrown when message batch size is less than 1.

21.176.5. Properties

21.176.5.1. TaskProcessing

Gets the collection of task IDs that are currently being processed.

public ICollection<string> TaskProcessing { get; }

21.176.5.1.1. Property Value

ICollection<string>

21.176.6. Methods

21.176.6.1. Check(HealthCheckTag)

Performs health checks on the pollster and its dependencies.

public Task<HealthCheckResult> Check(HealthCheckTag tag)

21.176.6.1.1. Parameters

tag HealthCheckTag

The type of health check to perform.

21.176.6.1.2. Returns

Task<HealthCheckResult>

The health check result.

21.176.6.2. Init(CancellationToken)

Initializes the pollster and its dependencies.

public Task Init(CancellationToken cancellationToken)

21.176.6.2.1. Parameters

cancellationToken CancellationToken

Token to cancel the initialization.

21.176.6.2.2. Returns

Task

A task representing the asynchronous initialization operation.

21.176.6.3. MainLoop()

Main processing loop for the pollster that fetches and processes tasks.

public Task MainLoop()

21.176.6.3.1. Returns

Task

A task representing the asynchronous operation.

21.176.6.4. StopCancelledTask()

Stops any cancelled tasks that are currently being processed.

public Task StopCancelledTask()

21.176.6.4.1. Returns

Task

A task representing the asynchronous operation.