Skip to content

Commit

Permalink
feat: Add result creation in Worker TaskHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
aneojgurhem committed Apr 6, 2023
1 parent db6ef03 commit 38c913e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/csharp/ArmoniK.Api.Worker/Worker/ITaskHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,13 @@ Task<CreateTaskReply> CreateTasksAsync(IEnumerable<TaskRequest> tasks,
/// <returns></returns>
Task SendResult(string key,
byte[] data);

/// <summary>
/// Create results metadata
/// </summary>
/// <param name="results">The collection of results to be created</param>
/// <returns>
/// The result creation response
/// </returns>
Task<CreateResultsMetaDataResponse> CreateResultsMetaDataAsync(IEnumerable<CreateResultsMetaDataRequest.Types.ResultCreate> results);
}
14 changes: 14 additions & 0 deletions packages/csharp/ArmoniK.Api.Worker/Worker/TaskHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,20 @@ public Task<byte[]> RequestCommonData(string key)
public Task<byte[]> RequestDirectData(string key)
=> throw new NotImplementedException();

/// <inheritdoc />
public async Task<CreateResultsMetaDataResponse> CreateResultsMetaDataAsync(IEnumerable<CreateResultsMetaDataRequest.Types.ResultCreate> results)
=> await client_.CreateResultsMetaDataAsync(new CreateResultsMetaDataRequest
{
CommunicationToken = Token,
Results =
{
results,
},
SessionId = sessionId_,
})
.ConfigureAwait(false);


/// <inheritdoc />
public async Task SendResult(string key,
byte[] data)
Expand Down

0 comments on commit 38c913e

Please sign in to comment.