From 8b327a4f8518e260a0125d661d52c89980c9c4c3 Mon Sep 17 00:00:00 2001
From: Adam Stone <8525409+adamjstone@users.noreply.github.com>
Date: Wed, 29 Jul 2020 23:16:00 -0500
Subject: [PATCH] #288 Refactor asynchronous operations. (#306)
---
.../Secrets/SecretStorePersistenceVehicle.cs | 4 ++--
.../TransportPrimitives/MessagingEntityClient.cs | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/RapidField.SolidInstruments.Cryptography/Secrets/SecretStorePersistenceVehicle.cs b/src/RapidField.SolidInstruments.Cryptography/Secrets/SecretStorePersistenceVehicle.cs
index 8581c475..985f697d 100644
--- a/src/RapidField.SolidInstruments.Cryptography/Secrets/SecretStorePersistenceVehicle.cs
+++ b/src/RapidField.SolidInstruments.Cryptography/Secrets/SecretStorePersistenceVehicle.cs
@@ -106,10 +106,10 @@ protected sealed override Task LoadPersistedStateAsync(SecretVault inMemoryStore
///
/// A task representing the asynchronous operation.
///
- protected sealed override Task PersistInMemoryStoreAsync(SecretVault inMemoryStore, IConcurrencyControlToken controlToken) => inMemoryStore.ExportAsync().ContinueWith(async exportTask =>
+ protected sealed override Task PersistInMemoryStoreAsync(SecretVault inMemoryStore, IConcurrencyControlToken controlToken) => inMemoryStore.ExportAsync().ContinueWith(exportTask =>
{
var inMemoryStoreCiphertext = ObscurityProcessor.EncryptToBase64String(exportTask.Result, ObscurityKey);
- await PersistInMemoryStoreAsync(inMemoryStore.SemanticIdentity, inMemoryStoreCiphertext).ConfigureAwait(false);
+ PersistInMemoryStoreAsync(inMemoryStore.SemanticIdentity, inMemoryStoreCiphertext).Wait();
});
///
diff --git a/src/RapidField.SolidInstruments.Messaging/TransportPrimitives/MessagingEntityClient.cs b/src/RapidField.SolidInstruments.Messaging/TransportPrimitives/MessagingEntityClient.cs
index 7a8e0890..eabb5cd5 100644
--- a/src/RapidField.SolidInstruments.Messaging/TransportPrimitives/MessagingEntityClient.cs
+++ b/src/RapidField.SolidInstruments.Messaging/TransportPrimitives/MessagingEntityClient.cs
@@ -142,13 +142,13 @@ public void RegisterMessageHandler(Action handleMessageAction)
///
public Task SendAsync(PrimitiveMessage message) => EntityType switch
{
- MessagingEntityType.Queue => EnsureQueueExistanceAsync(Path).ContinueWith(async ensureQueueExistenceTask =>
+ MessagingEntityType.Queue => EnsureQueueExistanceAsync(Path).ContinueWith(ensureQueueExistenceTask =>
{
- await Connection.Transport.SendToQueueAsync(Path, message).ConfigureAwait(false);
+ Connection.Transport.SendToQueueAsync(Path, message).Wait();
}),
- MessagingEntityType.Topic => EnsureTopicExistanceAsync(Path).ContinueWith(async ensureTopicExistenceTask =>
+ MessagingEntityType.Topic => EnsureTopicExistanceAsync(Path).ContinueWith(ensureTopicExistenceTask =>
{
- await Connection.Transport.SendToTopicAsync(Path, message).ConfigureAwait(false);
+ Connection.Transport.SendToTopicAsync(Path, message).Wait();
}),
_ => throw new UnsupportedSpecificationException($"The specified messaging entity type, {EntityType}, is not supported.")
};