17.171. 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
17.171.1. Implements
17.171.2. Properties
17.171.2.1. Folder
Folder in which data are sent between agent and worker
string Folder { get; }
17.171.2.1.1. Property Value
17.171.2.2. SessionId
Id of the session from the task associated to the agent
string SessionId { get; }
17.171.2.2.1. Property Value
17.171.2.3. Token
Unique token to identify agent and requests it should process
string Token { get; }
17.171.2.3.1. Property Value
17.171.3. Methods
17.171.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)
17.171.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
17.171.3.1.2. Returns
Reply sent to the worker with the id of the created result
17.171.3.2. CreateResultsAndSubmitChildTasksAsync(CancellationToken)
Create and populate results and submit child tasks after the parent task succeeds
Task CreateResultsAndSubmitChildTasksAsync(CancellationToken cancellationToken)
17.171.3.2.1. Parameters
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.171.3.2.2. Returns
Task representing the asynchronous execution of the method
17.171.3.3. CreateResultsMetaData(string, IEnumerable<ResultCreationRequest>, CancellationToken)
Create results metadata
Task<ICollection<Result>> CreateResultsMetaData(string token, IEnumerable<ResultCreationRequest> requests, CancellationToken cancellationToken)
17.171.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
17.171.3.3.2. Returns
Reply sent to the worker with the created results
17.171.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)
17.171.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
17.171.3.4.2. Returns
Id of the result sent to the worker
17.171.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)
17.171.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
17.171.3.5.2. Returns
Id of the result sent to the worker
17.171.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)
17.171.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
17.171.3.6.2. Returns
Id of the result sent to the worker
17.171.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)
17.171.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
17.171.3.7.2. Returns
Results which notification is successful
17.171.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)
17.171.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
17.171.3.8.2. Returns
Task<ICollection<TaskCreationRequest>>
Submitted tasks to send to the worker