Skip to content

Commit

Permalink
configurable parallelism
Browse files Browse the repository at this point in the history
  • Loading branch information
lemaitre-aneo committed Jun 10, 2024
1 parent ff2fe27 commit b38e4e5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Client/src/Common/Submitter/BaseClientSubmitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ public IEnumerable<string> SubmitTasksWithDependencies(IEnumerable<Tuple<byte[],
taskProperties.Add((result, payloadIndex, isLarge, dependencies, specificTaskOptions));
}

var uploadSmallPayloads = smallPayloadProperties.ParallelSelect(new ParallelTaskOptions(1,
var uploadSmallPayloads = smallPayloadProperties.ParallelSelect(new ParallelTaskOptions(properties_.MaxParallelChannels,
cancellationToken),
payload => Retry.WhileException(maxRetries,
2000,
Expand Down Expand Up @@ -521,7 +521,7 @@ await ChannelPool.GetAsync(cancellationToken)
.AsTask();


var uploadLargePayloads = largePayloadProperties.ParallelForEach(new ParallelTaskOptions(1,
var uploadLargePayloads = largePayloadProperties.ParallelForEach(new ParallelTaskOptions(properties_.MaxParallelChannels,
cancellationToken),
async payload =>
{
Expand Down Expand Up @@ -779,7 +779,9 @@ public async ValueTask<ResultStatusCollection> GetResultStatusAsync(IEnumerable<
nameof(Results.ResultsClient.GetResult));
return await result2TaskDic.Keys.ToChunks(100)
.ParallelSelect(async chunk =>
.ParallelSelect(new ParallelTaskOptions(properties_.MaxParallelChannels,
cancellationToken),
async chunk =>
{
await using var channel = await ChannelPool.GetAsync(cancellationToken)
.ConfigureAwait(false);
Expand Down

0 comments on commit b38e4e5

Please sign in to comment.