17.178. Class TaskHandler
Namespace: ArmoniK.Core.Common.Pollster
Assembly: ArmoniK.Core.Common.dll
public sealed class TaskHandler : IAsyncDisposable
17.178.1. Inheritance
17.178.2. Implements
17.178.3. Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
17.178.4. Constructors
17.178.4.1. TaskHandler(ISessionTable, ITaskTable, IResultTable, ISubmitter, DataPrefetcher, IWorkerStreamHandler, IQueueMessageHandler, ITaskProcessingChecker, string, string, ActivitySource, IAgentHandler, ILogger, Pollster, Action, ExceptionManager, FunctionExecutionMetrics<TaskHandler>)
public TaskHandler(ISessionTable sessionTable, ITaskTable taskTable, IResultTable resultTable, ISubmitter submitter, DataPrefetcher dataPrefetcher, IWorkerStreamHandler workerStreamHandler, IQueueMessageHandler messageHandler, ITaskProcessingChecker taskProcessingChecker, string ownerPodId, string ownerPodName, ActivitySource activitySource, IAgentHandler agentHandler, ILogger logger, Pollster pollsterOptions, Action onDispose, ExceptionManager exceptionManager, FunctionExecutionMetrics<TaskHandler> functionExecutionMetrics)
17.178.4.1.1. Parameters
sessionTable ISessionTable
taskTable ITaskTable
resultTable IResultTable
submitter ISubmitter
dataPrefetcher DataPrefetcher
workerStreamHandler IWorkerStreamHandler
messageHandler IQueueMessageHandler
taskProcessingChecker ITaskProcessingChecker
ownerPodId string
ownerPodName string
activitySource ActivitySource
agentHandler IAgentHandler
logger ILogger
pollsterOptions Pollster
onDispose Action
exceptionManager ExceptionManager
functionExecutionMetrics FunctionExecutionMetrics<TaskHandler>
17.178.5. Properties
17.178.5.1. StartedAt
Start date for the task handled by the current Task Handler
public DateTime StartedAt { get; }
17.178.5.1.1. Property Value
17.178.6. Methods
17.178.6.1. AcquireTask()
Acquisition of the task in the message given to the constructor
public Task<AcquisitionStatus> AcquireTask()
17.178.6.1.1. Returns
Integer representing whether the task has been acquired Acquired when return is 0
17.178.6.1.2. Exceptions
status of the task is not recognized
17.178.6.2. DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()
17.178.6.2.1. Returns
A task that represents the asynchronous dispose operation.
17.178.6.3. ExecuteTask()
Execution of the acquired task on the worker
public Task ExecuteTask()
17.178.6.3.1. Returns
Task representing the asynchronous execution of the method
17.178.6.3.2. Exceptions
wrong order of execution
ArmoniKException
worker pipe is not initialized
17.178.6.4. GetAcquiredTaskInfo()
Get the meta data of the acquired task
public TaskInfo GetAcquiredTaskInfo()
17.178.6.4.1. Returns
The metadata of the task
17.178.6.5. PostProcessing()
Post processing of the acquired task
public Task PostProcessing()
17.178.6.5.1. Returns
Task representing the asynchronous execution of the method
17.178.6.5.2. Exceptions
wrong order of execution
17.178.6.6. PreProcessing()
Preprocessing (including the data prefetching) of the acquired task
public Task PreProcessing()
17.178.6.6.1. Returns
Task representing the asynchronous execution of the method
17.178.6.6.2. Exceptions
wrong order of execution
ObjectDataNotFoundException
input data are not found
17.178.6.7. ReleaseAndPostponeTask(bool)
Release task from the current agent and set message to
public Task ReleaseAndPostponeTask(bool paused = false)
17.178.6.7.1. Parameters
paused bool
If task should be paused
17.178.6.7.2. Returns
Task representing the asynchronous execution of the method
17.178.6.7.3. Exceptions
wrong order of execution
17.178.6.8. StopCancelledTask()
Refresh task metadata and stop execution if current task should be cancelled
public Task<bool> StopCancelledTask()
17.178.6.8.1. Returns
Task representing the asynchronous execution of the method