Skip to content

Commit 5201220

Browse files
committed
Add missing ConfigureAwait(false)
1 parent 19cea8d commit 5201220

17 files changed

Lines changed: 27 additions & 19 deletions

ActiveMQ.Artemis.Client.sln.DotSettings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseConfigureAwaitFalse/@EntryIndexedValue">ERROR</s:String>
3+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=UseConfigureAwaitFalseForAsyncDisposable/@EntryIndexedValue">WARNING</s:String>
24
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /&gt;</s:String>
35
<s:Boolean x:Key="/Default/UserDictionary/Words/=Amqp/@EntryIndexedValue">True</s:Boolean>
46
<s:Boolean x:Key="/Default/UserDictionary/Words/=Amqps/@EntryIndexedValue">True</s:Boolean>

src/ArtemisNetClient.Extensions.DependencyInjection/ActiveMqArtemisClientDependencyInjectionExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ private static void AddConsumer(this IActiveMqBuilder builder,
371371
configureContextualReceiveObservableAction(contextualReceiveObservable);
372372
return new ActiveMqConsumer(provider, contextualReceiveObservable, async token =>
373373
{
374-
var connection = await provider.GetConnection(builder.Name, token);
374+
var connection = await provider.GetConnection(builder.Name, token).ConfigureAwait(false);
375375
return await connection.CreateConsumerAsync(consumerConfiguration, token).ConfigureAwait(false);
376376
}, handler);
377377
});
@@ -496,7 +496,7 @@ private static IActiveMqBuilder AddProducer<TProducer>(this IActiveMqBuilder bui
496496
};
497497
return new TypedActiveMqProducer<TProducer>(logger, async token =>
498498
{
499-
var connection = await provider.GetConnection(builder.Name, token);
499+
var connection = await provider.GetConnection(builder.Name, token).ConfigureAwait(false);
500500
return await connection.CreateProducerAsync(producerConfiguration, token).ConfigureAwait(false);
501501
}, contextualSendObservable);
502502
});

src/ArtemisNetClient.Extensions.DependencyInjection/ActiveMqTopologyManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ public async Task CreateTopologyAsync(CancellationToken cancellationToken)
2727
}
2828

2929
var connection = await _lazyConnection.GetValueAsync(cancellationToken).ConfigureAwait(false);
30-
await using var topologyManager = await connection.CreateTopologyManagerAsync(cancellationToken).ConfigureAwait(false);
30+
var topologyManager = await connection.CreateTopologyManagerAsync(cancellationToken).ConfigureAwait(false);
31+
await using var _ = topologyManager.ConfigureAwait(false);
3132

3233
foreach (var addressConfiguration in _addressConfigurations)
3334
{
34-
await topologyManager.DeclareAddressAsync(addressConfiguration.Key, addressConfiguration.Value, cancellationToken);
35+
await topologyManager.DeclareAddressAsync(addressConfiguration.Key, addressConfiguration.Value, cancellationToken).ConfigureAwait(false);
3536
}
3637

3738
var queues = await topologyManager.GetQueueNamesAsync(cancellationToken).ConfigureAwait(false);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
22
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp80</s:String>
3+
<s:String x:Key="/Default/CodeInspection/Daemon/ConfigureAwaitAnalysisMode/@EntryValue">Library</s:String>
34
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=observables/@EntryIndexedValue">True</s:Boolean>
45
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=options/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

src/ArtemisNetClient.Extensions.DependencyInjection/ConnectionProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public ConnectionProvider(IServiceProvider serviceProvider)
1919
public async ValueTask<IConnection> GetConnection(string name, CancellationToken cancellationToken)
2020
{
2121
var namedConnection = _serviceProvider.GetServices<NamedConnection>().First(x => x.Name == name);
22-
return await namedConnection.Connection.GetValueAsync(cancellationToken);
22+
return await namedConnection.Connection.GetValueAsync(cancellationToken).ConfigureAwait(false);
2323
}
2424

2525
public AsyncValueLazy<IConnection> GetConnection(string name)

src/ArtemisNetClient.Extensions.DependencyInjection/TypedActiveMqAnonymousProducer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public async ValueTask StartAsync(CancellationToken cancellationToken)
2727
throw new InvalidOperationException($"Producer with type {typeof(T).FullName} has already been initialized.");
2828
}
2929

30-
_producer = await _producerFactory(cancellationToken);
30+
_producer = await _producerFactory(cancellationToken).ConfigureAwait(false);
3131
}
3232

3333
public async ValueTask StopAsync()

src/ArtemisNetClient.Extensions.DependencyInjection/TypedActiveMqProducer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async ValueTask IActiveMqProducer.StartAsync(CancellationToken cancellationToken
2727
throw new InvalidOperationException($"Producer with type {typeof(T).FullName} has already been initialized.");
2828
}
2929

30-
_producer = await _producerFactory(cancellationToken);
30+
_producer = await _producerFactory(cancellationToken).ConfigureAwait(false);
3131
}
3232

3333
public async ValueTask StopAsync()
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2-
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp80</s:String></wpf:ResourceDictionary>
2+
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp80</s:String>
3+
<s:String x:Key="/Default/CodeInspection/Daemon/ConfigureAwaitAnalysisMode/@EntryValue">Library</s:String></wpf:ResourceDictionary>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeInspection/Daemon/ConfigureAwaitAnalysisMode/@EntryValue">Library</s:String></wpf:ResourceDictionary>

src/ArtemisNetClient.Testing/Listener/Extensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Reflection;
2-
using ActiveMQ.Artemis.Client.Testing.Utils;
32
using Amqp.Framing;
43
using Amqp.Listener;
54

0 commit comments

Comments
 (0)