Imap Fetch Stream Async Callback Delegate
An asynchronous callback used when fetching message streams.
Definition
Namespace: MailKit.Net.Imap
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
An awaitable task context.
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public delegate Task ImapFetchStreamAsyncCallback(
ImapFolder folder,
int index,
UniqueId uid,
Stream stream,
CancellationToken cancellationToken
)Parameters
- folder ImapFolder
- The IMAP folder that the message belongs to.
- index Int32
- The index of the message in the folder.
- uid UniqueId
- The UID of the message in the folder.
- stream Stream
- The raw message (or part) stream.
- cancellationToken CancellationToken
- The cancellation token.
Return Value
TaskAn awaitable task context.
Remarks
This callback is meant to be used with the various GetStreamsAsync methods.
Once this callback returns, the stream argument will be disposed, so it is important to consume the stream right away and not add it to a queue for later processing.