Skip to main content

Module keyed_message

Module keyed_message 

Source
Expand description

A message pair claims its caller key before any extra statement of the unit runs.

The claim decides a duplicate-key race, so a competing pair loses at the claim and replays the existing holder instead of failing at a later row.

Enums§

KeyedMessageWrite

Functions§

create_keyed_message_pair
Create exactly two caller-namespaced message notes or return the outbound holder after rolling back a competing pair. The comm layer verifies payload and sibling integrity before treating Existing as a successful replay.
create_keyed_message_pair_with_attachments
Include every copy’s attachments in the same unit, ahead of the key claim.
create_keyed_message_pair_with_extra_statements
Like create_keyed_message_pair_with_attachments, and also commit extra_statements in the same unit, after the attachments and after the key claim. The claim is the only statement that decides a duplicate-key race: a competing pair loses there, before any extra row is written, and the existing holder is returned. A winning pair commits the claim, the notes, the attachments and the extra rows together.
find_keyed_message_holder
Look up the live outbound holder without preparing or attempting a write. The comm layer must validate the request and intact pair before returning it.