Method CancelAsync
- Namespace
- MailFathom.Application.Mail.Export
- Assembly
- MailFathom.Application.dll
CancelAsync(MailAccountId, MailboxExportId, CancellationToken)
Stops an export that is still being written, and deletes whatever it had produced.
public Task<MailboxExport> CancelAsync(MailAccountId account, MailboxExportId export, CancellationToken cancellationToken)
Parameters
accountMailAccountIdThe account the export belongs to.
exportMailboxExportIdThe export's identity.
cancellationTokenCancellationTokenCancels the request.
Returns
- Task<MailboxExport>
The export as it now stands.
Remarks
Cancelling one that already finished is not a failure and not a cancellation either: the archive is there and the act to take on it is a deletion, so the export is answered as it stands. The writing job reads the record at its checkpoint, once every hundred messages, so a cancellation reaches it within a hundred messages rather than at the end of the mailbox.
Exceptions
- PrincipalNotAuthorizedException
Thrown when the caller does not hold the export permission.
- MailboxExportRefusedException
Thrown when the account holds no export under that identity.