You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When downloading multiple messages using one of the ImapFolder.GetStreams overloads, it is currently not possible to use an async method as ImapFetchStreamCallback. Many .NET APIs are async-first if not async-only nowadays, so one has to build complex workarounds to allow async processing of the messages.
Describe the solution you'd like
I'd like to have an async version of ImapFetchStreamCallback, e.g. ImapFetchStreamAsyncCallback:
Each ImapFolder.GetStreams method would get an overload accepting an ImapFetchStreamAsyncCallback.
If this feature is not too complicated, I'd be open to implement it and make a PR.
The text was updated successfully, but these errors were encountered:
lkstz
changed the title
Allow async ImapFetchStreamCallback for GetStreams methods
Allow async ImapFetchStreamCallback for ImapFolder.GetStreams methods
Nov 29, 2019
Hmmm, yes, this should have been an async callback. I must have missed this when I rewrote MailKit to be async from the ground up in the 2.0 rewrite.
I think the solution for now is probably to fix the GetStreamsAsync() methods to take an ImapFetchStreamAsyncCallback delegate instead of duplicating the API (which I really hate doing).
I'll leave the GetStreams() APIs alone, so they will continue to use the old callback delegate (which probably makes sense anyway since they probably don't care about being async).
In a future version, I'll change the ImapFetchStreamCallback delegate signature to also take a CancellationToken argument like I'm adding to the ImapFetchStreamAsyncCallback delegate signature.
Is your feature request related to a problem? Please describe.
When downloading multiple messages using one of the
ImapFolder.GetStreams
overloads, it is currently not possible to use an async method asImapFetchStreamCallback
. Many .NET APIs are async-first if not async-only nowadays, so one has to build complex workarounds to allow async processing of the messages.Describe the solution you'd like
I'd like to have an async version of
ImapFetchStreamCallback
, e.g.ImapFetchStreamAsyncCallback
:Each
ImapFolder.GetStreams
method would get an overload accepting anImapFetchStreamAsyncCallback
.If this feature is not too complicated, I'd be open to implement it and make a PR.
The text was updated successfully, but these errors were encountered: