Fix OperationCancelledException and add IAsyncEnumerable to wait without thread blocking (#1562)

* Fixed Task Scheduler operation cancelled error caused by Orphaned RunCleanup task on RequestQueue not being awaited on dispose

* Added async disposable interface to various components

* Added incorrect early marking of disposed for DiscordSocketApi client

* Added general task canceled exception catch to cleanup task

* Fix merge errors

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
Co-authored-by: quin lynch <lynchquin@gmail.com>
This commit is contained in:
James Grant
2022-01-11 17:24:30 +10:00
committed by GitHub
parent 4ed4718e18
commit cd36bb802b
8 changed files with 136 additions and 6 deletions

View File

@@ -8,7 +8,7 @@ namespace Discord
/// <summary>
/// Represents a generic Discord client.
/// </summary>
public interface IDiscordClient : IDisposable
public interface IDiscordClient : IDisposable, IAsyncDisposable
{
/// <summary>
/// Gets the current state of connection.