Skip to content

Commit 8bc743b

Browse files
authored
Drop IConsumerDispatcher.QueueAction(Action) (#1044)
* Drop legacy method * Protect from very unlikely weird situation when action throws OCE * Fix review comments
1 parent bddf349 commit 8bc743b

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

Source/EasyNetQ/Consumer/ConsumerDispatcher.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public ConsumerDispatcher(ConnectionConfiguration configuration)
1616
{
1717
Preconditions.CheckNotNull(configuration, "configuration");
1818

19-
2019
var thread = new Thread(_ =>
2120
{
2221
var blockingCollections = new[] {durableActions, transientActions};
@@ -28,7 +27,7 @@ public ConsumerDispatcher(ConnectionConfiguration configuration)
2827
);
2928
action();
3029
}
31-
catch (OperationCanceledException)
30+
catch (OperationCanceledException) when (cancellation.IsCancellationRequested)
3231
{
3332
break;
3433
}
@@ -52,12 +51,7 @@ public ConsumerDispatcher(ConnectionConfiguration configuration)
5251
thread.Start();
5352
}
5453

55-
public void QueueAction(Action action)
56-
{
57-
QueueAction(action, false);
58-
}
59-
60-
public void QueueAction(Action action, bool surviveDisconnect)
54+
public void QueueAction(Action action, bool surviveDisconnect = false)
6155
{
6256
Preconditions.CheckNotNull(action, "action");
6357

Source/EasyNetQ/Consumer/IConsumerDispatcher.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ namespace EasyNetQ.Consumer
44
{
55
public interface IConsumerDispatcher : IDisposable
66
{
7-
void QueueAction(Action action);
8-
void QueueAction(Action action, bool surviveDisconnect);
7+
void QueueAction(Action action, bool surviveDisconnect = false);
98
void OnDisconnected();
109
}
1110
}

0 commit comments

Comments
 (0)