Last active
February 23, 2019 17:33
-
-
Save MihaZupan/7e5e1673289e2b895c534d7a39e58397 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// doesn't block | |
void StartReceiving(Func<Update, Task> updateHandler, Func<Exception, Task> exceptionHandler); | |
// awaitable blocking task | |
async Task ReceiveAsync(Func<Update, Task> updateHandler, Func<Exception, Task>? exceptionHandler); | |
// calls GetUpdates after all updates are processed | |
async IAsyncEnumerable<Update> YieldUpdatesAsync(Func<Exception, Task>? exceptionHandler); | |
// keeps calling GetUpdates and enqueues updates internally, yielding them one by one | |
// implementation and different variants TBD | |
async IAsyncEnumerable<Update> YieldQueuedUpdatesAsync(Func<Exception, Task>? exceptionHandler); | |
// All variants also have optional `UpdateType[]?` and `CancellationToken` parameters. | |
// `exceptionHandler` is optional, except on `StartReceiving`. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment