26.177. 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
26.177.1. Inheritance
26.177.2. Implements
26.177.3. Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
26.177.4. Constructors
26.177.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)
26.177.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
26.177.5. Methods
26.177.5.1. DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()
26.177.5.1.1. Returns
A task that represents the asynchronous dispose operation.
26.177.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)
26.177.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
26.177.5.2.2. Returns
Task representing the asynchronous execution of the method
26.177.5.3. Stop(CancellationToken)
Stops the handler
public Task Stop(CancellationToken cancellationToken)
26.177.5.3.1. Parameters
cancellationToken CancellationToken
Token used to cancel the execution of the method
26.177.5.3.2. Returns
Task representing the asynchronous execution of the method