Click or drag to resize
MimeKit

ImapFetchStreamAsyncCallback Delegate

An asynchronous callback used when fetching message streams.

Namespace:  MailKit.Net.Imap
Assembly:  MailKit (in MailKit.dll) Version: 2.10.0
Syntax
C#
public delegate Task ImapFetchStreamAsyncCallback(
	ImapFolder folder,
	int index,
	UniqueId uid,
	Stream stream,
	CancellationToken cancellationToken
)

Parameters

folder
Type: MailKit.Net.ImapImapFolder
The IMAP folder that the message belongs to.
index
Type: SystemInt32
The index of the message in the folder.
uid
Type: MailKitUniqueId
The UID of the message in the folder.
stream
Type: System.IOStream
The raw message (or part) stream.
cancellationToken
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: Task
An 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.

See Also