Skip to content

Commit 60ab92d

Browse files
committed
Fix review comments
1 parent 3bae41c commit 60ab92d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Source/EasyNetQ/Consumer/ConsumerDispatcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public ConsumerDispatcher(ConnectionConfiguration configuration)
2424
while (!cancellation.IsCancellationRequested)
2525
try
2626
{
27-
if (BlockingCollection<Action>.TryTakeFromAny(blockingCollections, out var action, -1, cancellation.Token) >= 0)
27+
if (BlockingCollection<Action>.TryTakeFromAny(blockingCollections, out var action, Timeout.Infinite, cancellation.Token) >= 0)
2828
{
2929
action();
3030
}

Source/EasyNetQ/Producer/ClientCommandDispatcherSingleton.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ private void StartDispatcherThread(ConnectionConfiguration configuration)
101101
{
102102
try
103103
{
104-
if (queue.TryTake(out var channelAction, -1, cancellation.Token))
104+
if (queue.TryTake(out var channelAction, Timeout.Infinite, cancellation.Token))
105+
{
105106
channelAction();
107+
}
106108
}
107109
catch (OperationCanceledException) when (cancellation.IsCancellationRequested)
108110
{

0 commit comments

Comments
 (0)