21.169. Class AgentHandler

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

Represents the handler that will provide servers to process requests from worker

public sealed class AgentHandler : IAgentHandler, IAsyncDisposable

21.169.1. Inheritance

objectAgentHandler

21.169.2. Implements

IAgentHandler, IAsyncDisposable

21.169.3. Inherited Members

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

21.169.4. Constructors

21.169.4.1. AgentHandler(LoggerInit, ComputePlane, ISubmitter, IObjectStorage, IPushQueueStorage, IResultTable, ITaskTable, ILogger<AgentHandler>)

Initializes a new instance

public AgentHandler(LoggerInit loggerInit, ComputePlane computePlaneOptions, ISubmitter submitter, IObjectStorage objectStorage, IPushQueueStorage pushQueueStorage, IResultTable resultTable, ITaskTable taskTable, ILogger<AgentHandler> logger)

21.169.4.1.1. Parameters

loggerInit LoggerInit

Logger initializer used to configure the loggers needed by the worker

computePlaneOptions ComputePlane

Options needed for the creation of the servers

submitter ISubmitter

Interface to manage tasks

objectStorage IObjectStorage

Interface class to create object storage

pushQueueStorage IPushQueueStorage

Interface to put tasks in the queue

resultTable IResultTable

Interface to manage result states

taskTable ITaskTable

Interface to manage task states

logger ILogger<AgentHandler>

Logger used to produce logs for this class

21.169.5. Methods

21.169.5.1. DisposeAsync()

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

public ValueTask DisposeAsync()

21.169.5.1.1. Returns

ValueTask

A task that represents the asynchronous dispose operation.

21.169.5.2. Start(string, ILogger, SessionData, TaskData, string, CancellationToken)

Starts the handler

public Task<IAgent> Start(string token, ILogger logger, SessionData sessionData, TaskData taskData, string folder, CancellationToken cancellationToken)

21.169.5.2.1. Parameters

token string

Token that can be used to differentiate running tasks

logger ILogger

Logger that may be injected into the handler that embed preconfigured scopes

sessionData SessionData

Session metadata

taskData TaskData

Task metadata

folder string

Shared folder between Agent and Worker

cancellationToken CancellationToken

Token used to cancel the execution of the method

21.169.5.2.2. Returns

Task<IAgent>

Task representing the asynchronous execution of the method

21.169.5.3. Stop(CancellationToken)

Stops the handler

public Task Stop(CancellationToken cancellationToken)

21.169.5.3.1. Parameters

cancellationToken CancellationToken

Token used to cancel the execution of the method

21.169.5.3.2. Returns

Task

Task representing the asynchronous execution of the method