Removed AsyncContext in ExecuteAndWait

This commit is contained in:
RogueException
2016-01-18 04:56:19 -04:00
parent 6266350eaa
commit 034075d584

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>