Skip to content

Commit

Permalink
add degree of parallelism in sqs
Browse files Browse the repository at this point in the history
  • Loading branch information
mkgharbi-aneo committed Feb 25, 2025
1 parent 5a94168 commit aeae8ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Adaptors/SQS/src/PushQueueStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public async Task PushMessagesAsync(IEnumerable<MessageData> messages,
MessageBody = data.TaskId,
})
.Chunk(10)
.ParallelForEach(async entries =>
.ParallelForEach(new ParallelTaskOptions(options_.DegreeOfParallelism),
async entries =>
{
var entriesList = entries.ToList();
var response = await client_.SendMessageBatchAsync(new SendMessageBatchRequest
Expand Down
6 changes: 6 additions & 0 deletions Adaptors/SQS/src/SQS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,10 @@ internal class SQS
/// Set to 0 in order to disable long polling.
/// </summary>
public int WaitTimeSeconds { get; set; } = 20;

/// <summary>
/// Parallelism degree.
/// Set to 0 in order to disable parallelism.
/// </summary>
public int DegreeOfParallelism { get; set; } = 100;
}

0 comments on commit aeae8ee

Please sign in to comment.