45
45
using RabbitMQ . Client . Events ;
46
46
using RabbitMQ . Client . Exceptions ;
47
47
using RabbitMQ . Client . Framing . Impl ;
48
- using RabbitMQ . Util ;
49
48
50
49
namespace RabbitMQ . Client . Impl
51
50
{
@@ -75,10 +74,11 @@ internal abstract class ChannelBase : IChannel, IRecoverable
75
74
internal readonly IConsumerDispatcher ConsumerDispatcher ;
76
75
77
76
protected ChannelBase ( ConnectionConfig config , ISession session ,
78
- ushort consumerDispatchConcurrency = Constants . DefaultConsumerDispatchConcurrency )
77
+ ushort ? perChannelConsumerDispatchConcurrency = null )
79
78
{
80
79
ContinuationTimeout = config . ContinuationTimeout ;
81
- ConsumerDispatcher = BuildConsumerDispatcher ( config , consumerDispatchConcurrency ) ;
80
+ ConsumerDispatcher = new AsyncConsumerDispatcher ( this ,
81
+ perChannelConsumerDispatchConcurrency . GetValueOrDefault ( config . ConsumerDispatchConcurrency ) ) ;
82
82
Action < Exception , string > onException = ( exception , context ) =>
83
83
OnCallbackException ( CallbackExceptionEventArgs . Build ( exception , context ) ) ;
84
84
_basicAcksWrapper = new EventingWrapper < BasicAckEventArgs > ( "OnBasicAck" , onException ) ;
@@ -94,12 +94,6 @@ protected ChannelBase(ConnectionConfig config, ISession session,
94
94
Session = session ;
95
95
}
96
96
97
- private IConsumerDispatcher BuildConsumerDispatcher ( ConnectionConfig config , ushort perChannelConsumerDispatchConcurrency )
98
- {
99
- ushort cdc = Misc . DetermineConsumerDispatchConcurrency ( config , perChannelConsumerDispatchConcurrency ) ;
100
- return new AsyncConsumerDispatcher ( this , cdc ) ;
101
- }
102
-
103
97
internal TimeSpan HandshakeContinuationTimeout { get ; set ; } = TimeSpan . FromSeconds ( 10 ) ;
104
98
public TimeSpan ContinuationTimeout { get ; set ; }
105
99
0 commit comments