Skip to content

Commit

Permalink
add missing ConfigureAwait
Browse files Browse the repository at this point in the history
  • Loading branch information
crobibero committed Jun 3, 2020
1 parent 9661135 commit 2ac111d
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -88,17 +88,17 @@ public Task RunAsync()

private async void OnPackageInstalling(object sender, InstallationInfo e)
{
await SendMessageToAdminSessions("PackageInstalling", e);
await SendMessageToAdminSessions("PackageInstalling", e).ConfigureAwait(false);
}

private async void OnPackageInstallationCancelled(object sender, InstallationInfo e)
{
await SendMessageToAdminSessions("PackageInstallationCancelled", e);
await SendMessageToAdminSessions("PackageInstallationCancelled", e).ConfigureAwait(false);
}

private async void OnPackageInstallationCompleted(object sender, InstallationInfo e)
{
await SendMessageToAdminSessions("PackageInstallationCompleted", e);
await SendMessageToAdminSessions("PackageInstallationCompleted", e).ConfigureAwait(false);
}

private async void OnPackageInstallationFailed(object sender, InstallationFailedEventArgs e)
Expand All @@ -118,7 +118,7 @@ private async void OnTaskCompleted(object sender, TaskCompletionEventArgs e)
/// <param name="e">The e.</param>
private async void OnPluginUninstalled(object sender, IPlugin e)
{
await SendMessageToAdminSessions("PluginUninstalled", e);
await SendMessageToAdminSessions("PluginUninstalled", e).ConfigureAwait(false);
}

/// <summary>
Expand Down

2 comments on commit 2ac111d

@zehnerGIT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is ConfigureAwait here necessary?
ConfigureAwait prevents the block of the gui thread in desktop applications, but web applications have no gui thread and use a thread from the pool as default

@crobibero
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While ConfigureAwait isn't necessary here, it's best practice to use it in library code

Please sign in to comment.