Skip to content

Commit 1d509c7

Browse files
authored
Make ProcessMessages synchronous now that it no longer awaits (#177)
The dedup branch no longer awaits _messageClearer.Clear (it stages the position and persists it to the DeliveredPositionsId effect instead), so ProcessMessages has no remaining awaits. Change it from async Task to void and drop the await at both call sites (Push, FetchAndNotify). Both callers remain async for the fetch semaphore and message-store calls.
1 parent 4a275fb commit 1d509c7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Core/Cleipnir.ResilientFunctions/Queuing/QueueManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public async Task Push(IReadOnlyList<StoredMessage> messages)
136136
if (_thrownException != null)
137137
return;
138138

139-
await ProcessMessages(messages);
139+
ProcessMessages(messages);
140140
}
141141
finally
142142
{
@@ -200,7 +200,7 @@ private async Task FetchAndNotify()
200200
skipPositions = _fetchedPositions.ToList();
201201

202202
var messages = await _messageStore.GetMessages(_storedId, skipPositions);
203-
await ProcessMessages(messages);
203+
ProcessMessages(messages);
204204
}
205205
finally
206206
{
@@ -211,7 +211,7 @@ private async Task FetchAndNotify()
211211

212212
// Caller must hold _fetchSemaphore. Deserializes, dedups by idempotency-key and by already-fetched
213213
// position (so pushes are idempotent), and stages messages for delivery.
214-
private async Task ProcessMessages(IReadOnlyList<StoredMessage> messages)
214+
private void ProcessMessages(IReadOnlyList<StoredMessage> messages)
215215
{
216216
foreach (var (messageContent, messageType, position, _, idempotencyKey, sender, receiver) in messages)
217217
{

0 commit comments

Comments
 (0)