Interface IMailboxFolderSetNotificationSession
- Namespace
- MailFathom.Application.Synchronization.Sessions
- Assembly
- MailFathom.Application.dll
Waits on one long-lived session for the mail server to report that any of several folders changed.
public interface IMailboxFolderSetNotificationSession : IAsyncDisposable
- Inherited Members
Remarks
This is the same contract as IMailboxNotificationSession over a set rather than one folder, and it exists because a server that can report several folders over one connection makes the per-folder session a cost rather than a design: an account with six folders otherwise holds six authenticated connections open for the lifetime of the process.
It reads nothing, exactly as the single-folder session reads nothing. What it reports is which folder the server named, and the synchronization that follows is the ordinary pass over its own read-only session. Nothing here may fetch an envelope, a body, or a flag.
The session is long-lived, so its owner recycles it when the settings it was opened under are superseded. One session is used by one waiter at a time and nothing here is safe for concurrent use.
Methods
- WaitForFolderChangeAsync(TimeSpan, CancellationToken)
Waits until one of the watched folders changes or until the supplied wait elapses.