Skip to content

Commit 76abfd2

Browse files
committed
Cleanup unnecessary dispatcher channel methods
1 parent 59a0cd2 commit 76abfd2

File tree

3 files changed

+0
-63
lines changed

3 files changed

+0
-63
lines changed

projects/RabbitMQ.Client/client/impl/ConsumerDispatching/ConsumerDispatcherBase.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ public IAsyncBasicConsumer GetAndRemoveConsumer(string tag)
3131
return _consumers.Remove(tag, out IAsyncBasicConsumer? consumer) ? consumer : GetDefaultOrFallbackConsumer();
3232
}
3333

34-
public void Shutdown(ShutdownEventArgs reason)
35-
{
36-
DoShutdownConsumers(reason);
37-
InternalShutdown();
38-
}
39-
4034
public Task ShutdownAsync(ShutdownEventArgs reason)
4135
{
4236
DoShutdownConsumers(reason);
@@ -54,8 +48,6 @@ private void DoShutdownConsumers(ShutdownEventArgs reason)
5448

5549
protected abstract void ShutdownConsumer(IAsyncBasicConsumer consumer, ShutdownEventArgs reason);
5650

57-
protected abstract void InternalShutdown();
58-
5951
protected abstract Task InternalShutdownAsync();
6052

6153
// Do not inline as it's not the default case on a hot path

projects/RabbitMQ.Client/client/impl/ConsumerDispatching/ConsumerDispatcherChannelBase.cs

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -114,53 +114,6 @@ public void Quiesce()
114114
_quiesce = true;
115115
}
116116

117-
public void WaitForShutdown()
118-
{
119-
if (_disposed)
120-
{
121-
return;
122-
}
123-
124-
if (_quiesce)
125-
{
126-
try
127-
{
128-
if (false == _reader.Completion.Wait(TimeSpan.FromSeconds(2)))
129-
{
130-
ESLog.Warn("consumer dispatcher did not shut down in a timely fashion (sync)");
131-
}
132-
if (false == _worker.Wait(TimeSpan.FromSeconds(2)))
133-
{
134-
ESLog.Warn("consumer dispatcher did not shut down in a timely fashion (sync)");
135-
}
136-
}
137-
catch (AggregateException aex)
138-
{
139-
AggregateException aexf = aex.Flatten();
140-
bool foundUnexpectedException = false;
141-
foreach (Exception innerAexf in aexf.InnerExceptions)
142-
{
143-
if (false == (innerAexf is OperationCanceledException))
144-
{
145-
foundUnexpectedException = true;
146-
break;
147-
}
148-
}
149-
if (foundUnexpectedException)
150-
{
151-
ESLog.Warn("consumer dispatcher task had unexpected exceptions");
152-
}
153-
}
154-
catch (OperationCanceledException)
155-
{
156-
}
157-
}
158-
else
159-
{
160-
throw new InvalidOperationException("WaitForShutdown called but _quiesce is false");
161-
}
162-
}
163-
164117
public async Task WaitForShutdownAsync()
165118
{
166119
if (_disposed)
@@ -209,11 +162,6 @@ protected sealed override void ShutdownConsumer(IAsyncBasicConsumer consumer, Sh
209162
_writer.TryWrite(WorkStruct.CreateShutdown(consumer, reason));
210163
}
211164

212-
protected override void InternalShutdown()
213-
{
214-
_writer.Complete();
215-
}
216-
217165
protected override Task InternalShutdownAsync()
218166
{
219167
_writer.Complete();

projects/RabbitMQ.Client/client/impl/ConsumerDispatching/IConsumerDispatcher.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ ValueTask HandleBasicDeliverAsync(string consumerTag,
6262

6363
void Quiesce();
6464

65-
void Shutdown(ShutdownEventArgs reason);
66-
void WaitForShutdown();
67-
6865
Task ShutdownAsync(ShutdownEventArgs reason);
6966
Task WaitForShutdownAsync();
7067
}

0 commit comments

Comments
 (0)