Skip to main content

Module document

Module document 

Source
Expand description

Atomic document operations for apps that declare document-shaped persistence.

Structsยง

DocumentSnapshot
Holds the authoritative representation used by a subsequent compare-and-write.

Constantsยง

MAX_DOCUMENT_BYTES ๐Ÿ”’

Functionsยง

claim_worker
Claims document-backed work before any external delivery. App writes reject an active lease, and a crashed worker releases ownership through expiry.
compare_and_write ๐Ÿ”’
Writes the exact previously read representation through one guarded mutation.
complete_worker
Completes only the claimed document version, atomically releasing its lease.
has_due_work
Checks only declared document queue sections, without relational projection.
live_worker_lease ๐Ÿ”’
Tests persisted lease ownership using the shared epoch-clock representation.
read_document
Reads exactly one declared document without exporting any other app entities.
write_document
Commits one changed document atomically and rejects a stale snapshot.