21.181. Class TaskHandler

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

public sealed class TaskHandler : IAsyncDisposable

21.181.1. Inheritance

objectTaskHandler

21.181.2. Implements

IAsyncDisposable

21.181.3. Inherited Members

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

21.181.4. Constructors

21.181.4.1. TaskHandler(ISessionTable, ITaskTable, IResultTable, IPushQueueStorage, IObjectStorage, ISubmitter, DataPrefetcher, IWorkerStreamHandler, IQueueMessageHandler, ITaskProcessingChecker, string, string, ActivitySource, IAgentHandler, ILogger, Pollster, Submitter, Action, ExceptionManager, FunctionExecutionMetrics<TaskHandler>, HealthCheckRecord)

public TaskHandler(ISessionTable sessionTable, ITaskTable taskTable, IResultTable resultTable, IPushQueueStorage pushQueueStorage, IObjectStorage objectStorage, ISubmitter submitter, DataPrefetcher dataPrefetcher, IWorkerStreamHandler workerStreamHandler, IQueueMessageHandler messageHandler, ITaskProcessingChecker taskProcessingChecker, string ownerPodId, string ownerPodName, ActivitySource activitySource, IAgentHandler agentHandler, ILogger logger, Pollster pollsterOptions, Submitter submitterOptions, Action onDispose, ExceptionManager exceptionManager, FunctionExecutionMetrics<TaskHandler> functionExecutionMetrics, HealthCheckRecord healthCheckRecord)

21.181.4.1.1. Parameters

sessionTable ISessionTable

taskTable ITaskTable

resultTable IResultTable

pushQueueStorage IPushQueueStorage

objectStorage IObjectStorage

submitter ISubmitter

dataPrefetcher DataPrefetcher

workerStreamHandler IWorkerStreamHandler

messageHandler IQueueMessageHandler

taskProcessingChecker ITaskProcessingChecker

ownerPodId string

ownerPodName string

activitySource ActivitySource

agentHandler IAgentHandler

logger ILogger

pollsterOptions Pollster

submitterOptions Submitter

onDispose Action

exceptionManager ExceptionManager

functionExecutionMetrics FunctionExecutionMetrics<TaskHandler>

healthCheckRecord HealthCheckRecord

21.181.5. Properties

21.181.5.1. StartedAt

Start date for the task handled by the current Task Handler

public DateTime StartedAt { get; }

21.181.5.1.1. Property Value

DateTime

21.181.6. Methods

21.181.6.1. AcquireTask()

Acquisition of the task in the message given to the constructor

public Task<AcquisitionStatus> AcquireTask()

21.181.6.1.1. Returns

Task<AcquisitionStatus>

Integer representing whether the task has been acquired Acquired when return is 0

21.181.6.1.2. Exceptions

ArgumentException

status of the task is not recognized

21.181.6.2. DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public ValueTask DisposeAsync()

21.181.6.2.1. Returns

ValueTask

A task that represents the asynchronous dispose operation.

21.181.6.3. ExecuteTask()

Execution of the acquired task on the worker

public Task ExecuteTask()

21.181.6.3.1. Returns

Task

Task representing the asynchronous execution of the method

21.181.6.3.2. Exceptions

NullReferenceException

wrong order of execution

ArmoniKException

worker pipe is not initialized

21.181.6.4. GetAcquiredTaskInfo()

Get the meta data of the acquired task

public TaskInfo GetAcquiredTaskInfo()

21.181.6.4.1. Returns

TaskInfo

The metadata of the task

21.181.6.5. PostProcessing()

Post processing of the acquired task

public Task PostProcessing()

21.181.6.5.1. Returns

Task

Task representing the asynchronous execution of the method

21.181.6.5.2. Exceptions

NullReferenceException

wrong order of execution

21.181.6.6. PreProcessing()

Preprocessing (including the data prefetching) of the acquired task

public Task PreProcessing()

21.181.6.6.1. Returns

Task

Task representing the asynchronous execution of the method

21.181.6.6.2. Exceptions

NullReferenceException

wrong order of execution

ObjectDataNotFoundException

input data are not found

21.181.6.7. ReleaseAndPostponeTask(bool)

Release task from the current agent and set message to

public Task ReleaseAndPostponeTask(bool paused = false)

21.181.6.7.1. Parameters

paused bool

If task should be paused

21.181.6.7.2. Returns

Task

Task representing the asynchronous execution of the method

21.181.6.7.3. Exceptions

NullReferenceException

wrong order of execution

21.181.6.8. StopCancelledTask()

Refresh task metadata and stop execution if current task should be cancelled

public Task<bool> StopCancelledTask()

21.181.6.8.1. Returns

Task<bool>

Task representing the asynchronous execution of the method