Skip to content

Commit 5082dc6

Browse files
committed
Rename ConnectionShutdown to ConnectionShutdownAsync
1 parent ebb8e88 commit 5082dc6

19 files changed

+45
-45
lines changed

projects/RabbitMQ.Client/PublicAPI.Shipped.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@ RabbitMQ.Client.IConnection.ClientProperties.get -> System.Collections.Generic.I
450450
RabbitMQ.Client.IConnection.ClientProvidedName.get -> string
451451
RabbitMQ.Client.IConnection.CloseReason.get -> RabbitMQ.Client.ShutdownEventArgs
452452
RabbitMQ.Client.IConnection.ConnectionRecoveryError -> RabbitMQ.Client.Events.AsyncEventHandler<RabbitMQ.Client.Events.ConnectionRecoveryErrorEventArgs>
453-
RabbitMQ.Client.IConnection.ConnectionShutdown -> RabbitMQ.Client.Events.AsyncEventHandler<RabbitMQ.Client.ShutdownEventArgs>
454453
RabbitMQ.Client.IConnection.ConnectionUnblocked -> RabbitMQ.Client.Events.AsyncEventHandler<System.EventArgs>
455454
RabbitMQ.Client.IConnection.ConsumerTagChangeAfterRecovery -> RabbitMQ.Client.Events.AsyncEventHandler<RabbitMQ.Client.Events.ConsumerTagChangedAfterRecoveryEventArgs>
456455
RabbitMQ.Client.IConnection.Endpoint.get -> RabbitMQ.Client.AmqpTcpEndpoint
@@ -895,3 +894,4 @@ readonly RabbitMQ.Client.ConnectionConfig.ConsumerDispatchConcurrency -> ushort
895894
RabbitMQ.Client.IConnection.CreateChannelAsync(ushort? consumerDispatchConcurrency = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<RabbitMQ.Client.IChannel!>!
896895
RabbitMQ.Client.IConnection.CallbackExceptionAsync -> RabbitMQ.Client.Events.AsyncEventHandler<RabbitMQ.Client.Events.CallbackExceptionEventArgs!>!
897896
RabbitMQ.Client.IConnection.ConnectionBlockedAsync -> RabbitMQ.Client.Events.AsyncEventHandler<RabbitMQ.Client.Events.ConnectionBlockedEventArgs!>!
897+
RabbitMQ.Client.IConnection.ConnectionShutdownAsync -> RabbitMQ.Client.Events.AsyncEventHandler<RabbitMQ.Client.ShutdownEventArgs!>!

projects/RabbitMQ.Client/client/api/IConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public interface IConnection : INetworkConnection, IDisposable
155155
/// event handler is added to this event, the event handler
156156
/// will be fired immediately.
157157
/// </remarks>
158-
event AsyncEventHandler<ShutdownEventArgs> ConnectionShutdown;
158+
event AsyncEventHandler<ShutdownEventArgs> ConnectionShutdownAsync;
159159

160160
/// <summary>
161161
/// Raised when the connection completes recovery.

projects/RabbitMQ.Client/client/impl/AutorecoveringConnection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ internal AutorecoveringConnection(ConnectionConfig config, IEndpointResolver end
6666
_endpoints = endpoints;
6767
_innerConnection = innerConnection;
6868

69-
ConnectionShutdown += HandleConnectionShutdown;
69+
ConnectionShutdownAsync += HandleConnectionShutdown;
7070
_recoverySucceededWrapper = new AsyncEventingWrapper<EventArgs>("OnConnectionRecovery", onExceptionAsync);
7171
_connectionRecoveryErrorWrapper = new AsyncEventingWrapper<ConnectionRecoveryErrorEventArgs>("OnConnectionRecoveryError", onExceptionAsync);
7272
_consumerTagChangeAfterRecoveryWrapper = new AsyncEventingWrapper<ConsumerTagChangedAfterRecoveryEventArgs>("OnConsumerRecovery", onExceptionAsync);
@@ -114,10 +114,10 @@ public event AsyncEventHandler<ConnectionBlockedEventArgs> ConnectionBlockedAsyn
114114
remove => InnerConnection.ConnectionBlockedAsync -= value;
115115
}
116116

117-
public event AsyncEventHandler<ShutdownEventArgs> ConnectionShutdown
117+
public event AsyncEventHandler<ShutdownEventArgs> ConnectionShutdownAsync
118118
{
119-
add => InnerConnection.ConnectionShutdown += value;
120-
remove => InnerConnection.ConnectionShutdown -= value;
119+
add => InnerConnection.ConnectionShutdownAsync += value;
120+
remove => InnerConnection.ConnectionShutdownAsync -= value;
121121
}
122122

123123
public event AsyncEventHandler<EventArgs> ConnectionUnblocked

projects/RabbitMQ.Client/client/impl/Connection.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ internal Connection(ConnectionConfig config, IFrameHandler frameHandler)
6868
_callbackExceptionAsyncWrapper = new AsyncEventingWrapper<CallbackExceptionEventArgs>(string.Empty, (exception, context) => Task.CompletedTask);
6969
_connectionBlockedAsyncWrapper = new AsyncEventingWrapper<ConnectionBlockedEventArgs>("OnConnectionBlocked", onException);
7070
_connectionUnblockedWrapper = new AsyncEventingWrapper<EventArgs>("OnConnectionUnblocked", onException);
71-
_connectionShutdownWrapper = new AsyncEventingWrapper<ShutdownEventArgs>("OnShutdown", onException);
71+
_connectionShutdownAsyncWrapper = new AsyncEventingWrapper<ShutdownEventArgs>("OnShutdown", onException);
7272

7373
_sessionManager = new SessionManager(this, 0, config.MaxInboundMessageBodySize);
7474
_session0 = new MainSession(this, config.MaxInboundMessageBodySize);
@@ -146,15 +146,15 @@ public event AsyncEventHandler<RecoveringConsumerEventArgs> RecoveringConsumer
146146
}
147147
private AsyncEventingWrapper<RecoveringConsumerEventArgs> _consumerAboutToBeRecoveredWrapper;
148148

149-
public event AsyncEventHandler<ShutdownEventArgs> ConnectionShutdown
149+
public event AsyncEventHandler<ShutdownEventArgs> ConnectionShutdownAsync
150150
{
151151
add
152152
{
153153
ThrowIfDisposed();
154154
ShutdownEventArgs? reason = CloseReason;
155155
if (reason is null)
156156
{
157-
_connectionShutdownWrapper.AddHandler(value);
157+
_connectionShutdownAsyncWrapper.AddHandler(value);
158158
}
159159
else
160160
{
@@ -164,10 +164,10 @@ public event AsyncEventHandler<ShutdownEventArgs> ConnectionShutdown
164164
remove
165165
{
166166
ThrowIfDisposed();
167-
_connectionShutdownWrapper.RemoveHandler(value);
167+
_connectionShutdownAsyncWrapper.RemoveHandler(value);
168168
}
169169
}
170-
private AsyncEventingWrapper<ShutdownEventArgs> _connectionShutdownWrapper;
170+
private AsyncEventingWrapper<ShutdownEventArgs> _connectionShutdownAsyncWrapper;
171171

172172
/// <summary>
173173
/// This event is never fired by non-recovering connections but it is a part of the <see cref="IConnection"/> interface.
@@ -210,7 +210,7 @@ internal void TakeOver(Connection other)
210210
_callbackExceptionAsyncWrapper.Takeover(other._callbackExceptionAsyncWrapper);
211211
_connectionBlockedAsyncWrapper.Takeover(other._connectionBlockedAsyncWrapper);
212212
_connectionUnblockedWrapper.Takeover(other._connectionUnblockedWrapper);
213-
_connectionShutdownWrapper.Takeover(other._connectionShutdownWrapper);
213+
_connectionShutdownAsyncWrapper.Takeover(other._connectionShutdownAsyncWrapper);
214214
// TODO Why are other wrappers not taken over?
215215
}
216216

@@ -436,7 +436,7 @@ private async Task FinishCloseAsync(CancellationToken cancellationToken)
436436
private Task OnShutdown(ShutdownEventArgs reason)
437437
{
438438
ThrowIfDisposed();
439-
return _connectionShutdownWrapper.InvokeAsync(this, reason);
439+
return _connectionShutdownAsyncWrapper.InvokeAsync(this, reason);
440440
}
441441

442442
private bool SetCloseReason(ShutdownEventArgs reason)

projects/RabbitMQ.Client/client/impl/SessionBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected SessionBase(Connection connection, ushort channelNumber)
5353
ChannelNumber = channelNumber;
5454
if (channelNumber != 0)
5555
{
56-
connection.ConnectionShutdown += OnConnectionShutdownAsync;
56+
connection.ConnectionShutdownAsync += OnConnectionShutdownAsync;
5757
}
5858
RabbitMqClientEventSource.Log.ChannelOpened();
5959
}
@@ -94,7 +94,7 @@ public virtual Task OnConnectionShutdownAsync(object? conn, ShutdownEventArgs re
9494

9595
public virtual void OnSessionShutdown(ShutdownEventArgs reason)
9696
{
97-
Connection.ConnectionShutdown -= OnConnectionShutdownAsync;
97+
Connection.ConnectionShutdownAsync -= OnConnectionShutdownAsync;
9898
_sessionShutdownWrapper.Invoke(this, reason);
9999
}
100100

projects/Test/Applications/MassPublish/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static Program()
6868
static async Task Main()
6969
{
7070
using IConnection consumeConnection = await s_consumeConnectionFactory.CreateConnectionAsync();
71-
consumeConnection.ConnectionShutdown += ConnectionConnectionShutdown;
71+
consumeConnection.ConnectionShutdownAsync += ConnectionShutdownAsync;
7272

7373
using IChannel consumeChannel = await consumeConnection.CreateChannelAsync();
7474
consumeChannel.ChannelShutdown += Channel_ChannelShutdown;
@@ -92,7 +92,7 @@ await consumeChannel.BasicConsumeAsync(queue: QueueName, autoAck: true, consumer
9292
for (int i = 0; i < ConnectionCount; i++)
9393
{
9494
IConnection publishConnection = await s_publishConnectionFactory.CreateConnectionAsync($"{AppId}-PUBLISH-{i}");
95-
publishConnection.ConnectionShutdown += ConnectionConnectionShutdown;
95+
publishConnection.ConnectionShutdownAsync += ConnectionShutdownAsync;
9696
publishConnections.Add(publishConnection);
9797
}
9898

@@ -163,7 +163,7 @@ private static void PublishChannel_BasicNacks(object sender, BasicNackEventArgs
163163
Console.Error.WriteLine("[ERROR] unexpected nack on publish: {0}", e);
164164
}
165165

166-
private static Task ConnectionConnectionShutdown(object sender, ShutdownEventArgs e)
166+
private static Task ConnectionShutdownAsync(object sender, ShutdownEventArgs e)
167167
{
168168
if (e.Initiator != ShutdownInitiator.Application)
169169
{

projects/Test/Common/IntegrationFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ protected void AddCallbackShutdownHandlers()
278278
{
279279
if (_conn != null)
280280
{
281-
_conn.ConnectionShutdown += (o, ea) =>
281+
_conn.ConnectionShutdownAsync += (o, ea) =>
282282
{
283283
HandleConnectionShutdown(_conn, ea, (args) =>
284284
{
@@ -531,7 +531,7 @@ protected ConnectionFactory CreateConnectionFactory(
531531
};
532532
}
533533

534-
protected Task HandleConnectionShutdown(object sender, ShutdownEventArgs args)
534+
protected Task HandleConnectionShutdownAsync(object sender, ShutdownEventArgs args)
535535
{
536536
if (args.Initiator != ShutdownInitiator.Application)
537537
{

projects/Test/Common/TestConnectionRecoveryBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ protected static TaskCompletionSource<bool> PrepareForShutdown(IConnection conn)
229229
var tcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
230230

231231
AutorecoveringConnection aconn = conn as AutorecoveringConnection;
232-
aconn.ConnectionShutdown += (c, args) =>
232+
aconn.ConnectionShutdownAsync += (c, args) =>
233233
{
234234
tcs.TrySetResult(true);
235235
return Task.CompletedTask;

projects/Test/Integration/ConnectionRecovery/EventHandlerRecovery/Connection/TestShutdownEventHandlers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public TestShutdownEventHandlers(ITestOutputHelper output) : base(output)
4646
public async Task TestShutdownEventHandlers_Called()
4747
{
4848
int counter = 0;
49-
_conn.ConnectionShutdown += (c, args) =>
49+
_conn.ConnectionShutdownAsync += (c, args) =>
5050
{
5151
Interlocked.Increment(ref counter);
5252
return Task.CompletedTask;

projects/Test/Integration/TestAsyncConsumer.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public async Task TestBasicRoundtripConcurrent()
8787
bool body2Received = false;
8888
try
8989
{
90-
_conn.ConnectionShutdown += (o, ea) =>
90+
_conn.ConnectionShutdownAsync += (o, ea) =>
9191
{
9292
HandleConnectionShutdown(_conn, ea, (args) =>
9393
{
@@ -180,7 +180,7 @@ public async Task TestBasicRoundtripConcurrentManyMessages()
180180

181181
try
182182
{
183-
_conn.ConnectionShutdown += (o, ea) =>
183+
_conn.ConnectionShutdownAsync += (o, ea) =>
184184
{
185185
HandleConnectionShutdown(_conn, ea, (args) =>
186186
{
@@ -204,7 +204,7 @@ public async Task TestBasicRoundtripConcurrentManyMessages()
204204
{
205205
using (IConnection publishConn = await _connFactory.CreateConnectionAsync())
206206
{
207-
publishConn.ConnectionShutdown += (o, ea) =>
207+
publishConn.ConnectionShutdownAsync += (o, ea) =>
208208
{
209209
HandleConnectionShutdown(publishConn, ea, (args) =>
210210
{
@@ -248,7 +248,7 @@ public async Task TestBasicRoundtripConcurrentManyMessages()
248248
{
249249
using (IConnection consumeConn = await _connFactory.CreateConnectionAsync())
250250
{
251-
consumeConn.ConnectionShutdown += (o, ea) =>
251+
consumeConn.ConnectionShutdownAsync += (o, ea) =>
252252
{
253253
HandleConnectionShutdown(consumeConn, ea, (args) =>
254254
{
@@ -347,7 +347,7 @@ public async Task TestBasicRejectAsync()
347347

348348
try
349349
{
350-
_conn.ConnectionShutdown += (o, ea) =>
350+
_conn.ConnectionShutdownAsync += (o, ea) =>
351351
{
352352
HandleConnectionShutdown(_conn, ea, (args) =>
353353
{
@@ -444,7 +444,7 @@ public async Task TestBasicAckAsync()
444444

445445
var publishSyncSource = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
446446

447-
_conn.ConnectionShutdown += (o, ea) =>
447+
_conn.ConnectionShutdownAsync += (o, ea) =>
448448
{
449449
HandleConnectionShutdown(_conn, ea, (args) =>
450450
{
@@ -509,7 +509,7 @@ public async Task TestBasicNackAsync()
509509

510510
var publishSyncSource = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
511511

512-
_conn.ConnectionShutdown += (o, ea) =>
512+
_conn.ConnectionShutdownAsync += (o, ea) =>
513513
{
514514
HandleConnectionShutdown(_conn, ea, (args) =>
515515
{
@@ -616,7 +616,7 @@ public async Task TestCreateChannelWithinAsyncConsumerCallback_GH650()
616616
tcs.SetCanceled();
617617
});
618618

619-
_conn.ConnectionShutdown += (o, ea) =>
619+
_conn.ConnectionShutdownAsync += (o, ea) =>
620620
{
621621
HandleConnectionShutdown(_conn, ea, (args) =>
622622
{

0 commit comments

Comments
 (0)