Table of Contents

Constructor DatabaseBackedPayload

Namespace
MailFathom.Application.EmailContent.Move
Assembly
MailFathom.Application.dll

DatabaseBackedPayload(EmailContentKind, Guid, long, ReadOnlyMemory<byte>)

One payload the database still holds, as the move reads it before deciding to carry it.

public DatabaseBackedPayload(EmailContentKind Kind, Guid PayloadId, long ByteLength, ReadOnlyMemory<byte> Sha256Hash)

Parameters

Kind EmailContentKind

Which of the five payload kinds this is, which decides the table it lives in.

PayloadId Guid

The identity of the row holding it, which is what the walk is ordered by.

ByteLength long

How many bytes of raw MIME the row records.

Sha256Hash ReadOnlyMemory<byte>

The digest the row records over them.

Remarks

The bytes are deliberately absent. A batch names as many payloads as the pass may carry, and a batch that carried their contents would hold every one of them at once — which is the whole message multiplied by the batch size, over a walk whose reason for existing is that the mail is large. The move reads one payload's bytes at the moment it carries them and lets go of them before it reads the next.

The length and the digest come from the row rather than from the bytes, because they are what the copy is verified against. Reading them here, in the same query that named the payload, is what keeps the move from verifying an object against a row a concurrent write had already replaced.