Skip to content

Commit 83e5330

Browse files
committed
* Formatting. I prefer .ConfigureAwait(false); to be on its own line.
1 parent 3916bd8 commit 83e5330

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,8 @@ public async Task<IConnection> CreateConnectionAsync(IEndpointResolver endpointR
561561
{
562562
if (AutomaticRecoveryEnabled)
563563
{
564-
return await AutorecoveringConnection.CreateAsync(config, endpointResolver, cancellationToken).ConfigureAwait(false);
564+
return await AutorecoveringConnection.CreateAsync(config, endpointResolver, cancellationToken)
565+
.ConfigureAwait(false);
565566
}
566567
else
567568
{
@@ -620,7 +621,8 @@ internal async Task<IFrameHandler> CreateFrameHandlerAsync(
620621
AmqpTcpEndpoint endpoint, CancellationToken cancellationToken)
621622
{
622623
cancellationToken.ThrowIfCancellationRequested();
623-
SocketFrameHandler frameHandler = await SocketFrameHandler.CreateAsync(endpoint, SocketFactory, RequestedConnectionTimeout, cancellationToken).ConfigureAwait(false);
624+
SocketFrameHandler frameHandler = await SocketFrameHandler.CreateAsync(endpoint, SocketFactory, RequestedConnectionTimeout, cancellationToken)
625+
.ConfigureAwait(false);
624626
return ConfigureFrameHandler(frameHandler);
625627
}
626628

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ public Func<IRecordedExchange, Exception, bool> ExchangeRecoveryExceptionConditi
3333
set
3434
{
3535
if (_exchangeRecoveryExceptionCondition != null)
36+
{
3637
throw new InvalidOperationException($"Cannot modify {nameof(ExchangeRecoveryExceptionCondition)} after it has been initialized.");
38+
}
3739

3840
_exchangeRecoveryExceptionCondition = value ?? throw new ArgumentNullException(nameof(ExchangeRecoveryExceptionCondition));
3941
}
@@ -50,7 +52,9 @@ public Func<IRecordedQueue, Exception, bool> QueueRecoveryExceptionCondition
5052
set
5153
{
5254
if (_queueRecoveryExceptionCondition != null)
55+
{
5356
throw new InvalidOperationException($"Cannot modify {nameof(QueueRecoveryExceptionCondition)} after it has been initialized.");
57+
}
5458

5559
_queueRecoveryExceptionCondition = value ?? throw new ArgumentNullException(nameof(QueueRecoveryExceptionCondition));
5660
}
@@ -67,7 +71,9 @@ public Func<IRecordedBinding, Exception, bool> BindingRecoveryExceptionCondition
6771
set
6872
{
6973
if (_bindingRecoveryExceptionCondition != null)
74+
{
7075
throw new InvalidOperationException($"Cannot modify {nameof(BindingRecoveryExceptionCondition)} after it has been initialized.");
76+
}
7177

7278
_bindingRecoveryExceptionCondition = value ?? throw new ArgumentNullException(nameof(BindingRecoveryExceptionCondition));
7379
}
@@ -84,7 +90,9 @@ public Func<IRecordedConsumer, Exception, bool> ConsumerRecoveryExceptionConditi
8490
set
8591
{
8692
if (_consumerRecoveryExceptionCondition != null)
93+
{
8794
throw new InvalidOperationException($"Cannot modify {nameof(ConsumerRecoveryExceptionCondition)} after it has been initialized.");
95+
}
8896

8997
_consumerRecoveryExceptionCondition = value ?? throw new ArgumentNullException(nameof(ConsumerRecoveryExceptionCondition));
9098
}

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,15 @@ void onException(Exception exception, string context) =>
7676
_innerConnection.OnCallbackException(CallbackExceptionEventArgs.Build(exception, context));
7777
}
7878

79-
internal static async ValueTask<AutorecoveringConnection> CreateAsync(ConnectionConfig config, IEndpointResolver endpoints, CancellationToken cancellationToken)
79+
internal static async ValueTask<AutorecoveringConnection> CreateAsync(ConnectionConfig config, IEndpointResolver endpoints,
80+
CancellationToken cancellationToken)
8081
{
81-
IFrameHandler fh = await endpoints.SelectOneAsync(config.FrameHandlerFactoryAsync, cancellationToken).ConfigureAwait(false);
82+
IFrameHandler fh = await endpoints.SelectOneAsync(config.FrameHandlerFactoryAsync, cancellationToken)
83+
.ConfigureAwait(false);
8284
Connection innerConnection = new(config, fh);
8385
AutorecoveringConnection connection = new(config, endpoints, innerConnection);
84-
await innerConnection.OpenAsync(cancellationToken).ConfigureAwait(false);
86+
await innerConnection.OpenAsync(cancellationToken)
87+
.ConfigureAwait(false);
8588
return connection;
8689
}
8790

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,16 @@ public TimeSpan WriteTimeout
134134
public static async Task<SocketFrameHandler> CreateAsync(AmqpTcpEndpoint amqpTcpEndpoint, Func<AddressFamily, ITcpClient> socketFactory,
135135
TimeSpan connectionTimeout, CancellationToken cancellationToken)
136136
{
137-
ITcpClient socket = await SocketFactory.OpenAsync(amqpTcpEndpoint, socketFactory, connectionTimeout, cancellationToken).ConfigureAwait(false);
137+
ITcpClient socket = await SocketFactory.OpenAsync(amqpTcpEndpoint, socketFactory, connectionTimeout, cancellationToken)
138+
.ConfigureAwait(false);
138139
Stream stream = socket.GetStream();
139140

140141
if (amqpTcpEndpoint.Ssl.Enabled)
141142
{
142143
try
143144
{
144-
stream = await SslHelper.TcpUpgradeAsync(stream, amqpTcpEndpoint.Ssl, cancellationToken).ConfigureAwait(false);
145+
stream = await SslHelper.TcpUpgradeAsync(stream, amqpTcpEndpoint.Ssl, cancellationToken)
146+
.ConfigureAwait(false);
145147
}
146148
catch
147149
{

0 commit comments

Comments
 (0)