21.175. 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.175.1. Implements
21.175.2. Properties
21.175.2.1. Folder
Folder in which data are sent between agent and worker
string Folder { get; }
21.175.2.1.1. Property Value
21.175.2.2. SessionId
Id of the session from the task associated to the agent
string SessionId { get; }
21.175.2.2.1. Property Value
21.175.2.3. Token
Unique token to identify agent and requests it should process
string Token { get; }
21.175.2.3.1. Property Value
21.175.3. Methods
21.175.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.175.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.175.3.1.2. Returns
Reply sent to the worker with the id of the created result
21.175.3.2. CreateResultsAndSubmitChildTasksAsync(CancellationToken)
Create and populate results and submit child tasks after the parent task succeeds
Task CreateResultsAndSubmitChildTasksAsync(CancellationToken cancellationToken)
21.175.3.2.1. Parameters
cancellationToken CancellationToken
Token used to cancel the execution of the method
21.175.3.2.2. Returns
Task representing the asynchronous execution of the method
21.175.3.3. CreateResultsMetaData(string, IEnumerable<ResultCreationRequest>, CancellationToken)
Create results metadata
Task<ICollection<Result>> CreateResultsMetaData(string token, IEnumerable<ResultCreationRequest> requests, CancellationToken cancellationToken)
21.175.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.175.3.3.2. Returns
Reply sent to the worker with the created results
21.175.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.175.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.175.3.4.2. Returns
Id of the result sent to the worker
21.175.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.175.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.175.3.5.2. Returns
Id of the result sent to the worker
21.175.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.175.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.175.3.6.2. Returns
Id of the result sent to the worker
21.175.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.175.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.175.3.7.2. Returns
Results which notification is successful
21.175.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.175.3.8.1. Parameters
requests ICollection<TaskSubmissionRequest>
Requests containing the tasks to submit
taskOptions TaskOptions?
Options to apply to the tasks
sessionId string
Session id to which the tasks belong
token string
Worker token for request validation
cancellationToken CancellationToken
Token used to cancel the execution of the method
21.175.3.8.2. Returns
Task<ICollection<TaskCreationRequest>>
Submitted tasks to send to the worker