21.172. Interface IAgent

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

Interface for implementing methods for the agent gRPC service that receives requests from the worker

public interface IAgent : IDisposable

21.172.1. Implements

IDisposable

21.172.2. Properties

21.172.2.1. Folder

Folder in which data are sent between agent and worker

string Folder { get; }

21.172.2.1.1. Property Value

string

21.172.2.2. SessionId

Id of the session from the task associated to the agent

string SessionId { get; }

21.172.2.2.1. Property Value

string

21.172.2.3. Token

Unique token to identify agent and requests it should process

string Token { get; }

21.172.2.3.1. Property Value

string

21.172.3. Methods

21.172.3.1. CreateResults(string, IEnumerable<(ResultCreationRequest request, ReadOnlyMemory<byte> data)>, CancellationToken)

Create a result (with data and metadata)

Task<ICollection<Result>> CreateResults(string token, IEnumerable<(ResultCreationRequest request, ReadOnlyMemory<byte> data)> requests, CancellationToken cancellationToken)

21.172.3.1.1. Parameters

token string

Worker token for request validation

requests IEnumerable<(ResultCreationRequest request, ReadOnlyMemory<byte> data)>

Requests containing the result to create and their data

cancellationToken CancellationToken

Token used to cancel the execution of the method

21.172.3.1.2. Returns

Task<ICollection<Result>>

Reply sent to the worker with the id of the created result

21.172.3.2. CreateResultsAndSubmitChildTasksAsync(CancellationToken)

Create and populate results and submit child tasks after the parent task succeeds

Task CreateResultsAndSubmitChildTasksAsync(CancellationToken cancellationToken)

21.172.3.2.1. Parameters

cancellationToken CancellationToken

Token used to cancel the execution of the method

21.172.3.2.2. Returns

Task

Task representing the asynchronous execution of the method

21.172.3.3. CreateResultsMetaData(string, IEnumerable<ResultCreationRequest>, CancellationToken)

Create results metadata

Task<ICollection<Result>> CreateResultsMetaData(string token, IEnumerable<ResultCreationRequest> requests, CancellationToken cancellationToken)

21.172.3.3.1. Parameters

token string

Worker token for request validation

requests IEnumerable<ResultCreationRequest>

Requests containing the results to create

cancellationToken CancellationToken

Token used to cancel the execution of the method

21.172.3.3.2. Returns

Task<ICollection<Result>>

Reply sent to the worker with the created results

21.172.3.4. GetCommonData(string, string, CancellationToken)

Get Common data from data storage as file in shared folder

Task<string> GetCommonData(string token, string resultId, CancellationToken cancellationToken)

21.172.3.4.1. Parameters

token string

Worker token for request validation

resultId string

Result id to retrieve

cancellationToken CancellationToken

Token used to cancel the execution of the method

21.172.3.4.2. Returns

Task<string>

Id of the result sent to the worker

21.172.3.5. GetDirectData(string, string, CancellationToken)

Get Direct data from user as file in shared folder

Task<string> GetDirectData(string token, string resultId, CancellationToken cancellationToken)

21.172.3.5.1. Parameters

token string

Worker token for request validation

resultId string

Result id to retrieve

cancellationToken CancellationToken

Token used to cancel the execution of the method

21.172.3.5.2. Returns

Task<string>

Id of the result sent to the worker

21.172.3.6. GetResourceData(string, string, CancellationToken)

Get Resource data from data storage as file in shared folder

Task<string> GetResourceData(string token, string resultId, CancellationToken cancellationToken)

21.172.3.6.1. Parameters

token string

Worker token for request validation

resultId string

Result id to retrieve

cancellationToken CancellationToken

Token used to cancel the execution of the method

21.172.3.6.2. Returns

Task<string>

Id of the result sent to the worker

21.172.3.7. NotifyResultData(string, ICollection<string>, CancellationToken)

Put the results created as a file in the task into object storage

Task<ICollection<string>> NotifyResultData(string token, ICollection<string> resultIds, CancellationToken cancellationToken)

21.172.3.7.1. Parameters

token string

Worker token for request validation

resultIds ICollection<string>

Results to put in the object storage

cancellationToken CancellationToken

Token used to cancel the execution of the method

21.172.3.7.2. Returns

Task<ICollection<string>>

Results which notification is successful

21.172.3.8. SubmitTasks(ICollection<TaskSubmissionRequest>, TaskOptions?, string, string, CancellationToken)

Submit tasks with payload already existing

Task<ICollection<TaskCreationRequest>> SubmitTasks(ICollection<TaskSubmissionRequest> requests, TaskOptions? taskOptions, string sessionId, string token, CancellationToken cancellationToken)

21.172.3.8.1. Parameters

requests ICollection<TaskSubmissionRequest>

Requests containing the tasks to submit

taskOptions TaskOptions?

sessionId string

token string

cancellationToken CancellationToken

Token used to cancel the execution of the method

21.172.3.8.2. Returns

Task<ICollection<TaskCreationRequest>>

Submitted tasks to send to the worker