Browse Source

Added a proper async context to Run(), renamed parameter-less Run to Wait

pull/22/merge
RogueException 9 years ago
parent
commit
934bfebc9b
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/Discord.Net/DiscordClient.cs

+ 2
- 2
src/Discord.Net/DiscordClient.cs View File

@@ -1052,13 +1052,13 @@ namespace Discord
{
try
{
asyncAction().GetAwaiter().GetResult(); //Avoids creating AggregateExceptions
AsyncContext.Run(asyncAction);
}
catch (TaskCanceledException) { }
_disconnectedEvent.WaitOne();
}
/// <summary> Blocking call that will not return until client has been stopped. This is mainly intended for use in console applications. </summary>
public void Run()
public void Wait()
{
_disconnectedEvent.WaitOne();
}


Loading…
Cancel
Save