Browse Source

Removed AsyncContext in ExecuteAndWait

tags/docs-0.9
RogueException 9 years ago
parent
commit
034075d584
1 changed files with 1 additions and 5 deletions
  1. +1
    -5
      src/Discord.Net/DiscordClient.cs

+ 1
- 5
src/Discord.Net/DiscordClient.cs View File

@@ -1043,11 +1043,7 @@ namespace Discord
/// <summary> Blocking call that will execute the provided async method and wait until client has been manually stopped. This is mainly intended for use in console applications. </summary>
public void ExecuteAndWait(Func<Task> asyncAction)
{
try
{
AsyncContext.Run(asyncAction);
}
catch (TaskCanceledException) { }
asyncAction().GetAwaiter().GetResult();
_disconnectedEvent.WaitOne();
}
/// <summary> Blocking call and wait until client has been manually stopped. This is mainly intended for use in console applications. </summary>


Loading…
Cancel
Save