Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::timeline::JournalSink Class Referenceabstract

Synchronous durability boundary used by DocumentSession. More...

#include <journal.hpp>

Public Member Functions

virtual ~JournalSink ()=default
 JournalSink (const JournalSink &)=delete
JournalSink & operator= (const JournalSink &)=delete
virtual runtime::Result< bool, JournalSinkError > append_batch (const JournalEntry &entry) noexcept=0
 Makes a complete transaction entry durable as one batch.
virtual runtime::Result< bool, JournalSinkError > checkpoint (const Project &snapshot, DocumentRevision durable_revision) noexcept=0
 Installs a checkpoint before entries through its revision are discarded.
virtual runtime::Result< bool, JournalSinkError > validate_restore (const Project &, DocumentRevision) noexcept
 Validates attachment to an already-durable snapshot and revision.

Protected Member Functions

 JournalSink ()=default

Detailed Description

Synchronous durability boundary used by DocumentSession.

Implementations are retained by shared ownership. Calls are serialized by the originating session and execute while its writer lock is held, so a sink must not call lock-taking APIs on that session. Methods are noexcept and must translate exceptions or platform failures into JournalSinkError.

Constructor & Destructor Documentation

◆ ~JournalSink()

virtual pulp::timeline::JournalSink::~JournalSink ( )
virtualdefault

◆ JournalSink() [1/2]

pulp::timeline::JournalSink::JournalSink ( const JournalSink & )
delete

◆ JournalSink() [2/2]

pulp::timeline::JournalSink::JournalSink ( )
protecteddefault

Member Function Documentation

◆ append_batch()

virtual runtime::Result< bool, JournalSinkError > pulp::timeline::JournalSink::append_batch ( const JournalEntry & entry)
pure virtualnoexcept

Makes a complete transaction entry durable as one batch.

Returns Ok(true) only after the complete transaction batch is durable. Ok(false) is a durability failure and permanently rejects later durable writes from the attached session. The session writer lock is held during this call, so implementations must not invoke lock-taking APIs on the originating DocumentSession. Any result other than Ok(true) permanently rejects later durable writes from that session.

Implemented in pulp::timeline::FileJournal.

◆ checkpoint()

virtual runtime::Result< bool, JournalSinkError > pulp::timeline::JournalSink::checkpoint ( const Project & snapshot,
DocumentRevision durable_revision )
pure virtualnoexcept

Installs a checkpoint before entries through its revision are discarded.

Durably installs the snapshot before discarding journal entries through durable_revision. Only Ok(true) acknowledges durability; the session retains its prior checkpoint on any other result. The session writer lock is held during this call, so implementations must not invoke lock-taking APIs on the originating DocumentSession. Any result other than Ok(true) permanently rejects later durable writes from that session.

Implemented in pulp::timeline::FileJournal.

◆ operator=()

JournalSink & pulp::timeline::JournalSink::operator= ( const JournalSink & )
delete

◆ validate_restore()

virtual runtime::Result< bool, JournalSinkError > pulp::timeline::JournalSink::validate_restore ( const Project & ,
DocumentRevision  )
inlinevirtualnoexcept

Validates attachment to an already-durable snapshot and revision.

Verifies that an already-durable sink exactly matches a recovered snapshot and revision before a session attaches to it. Only Ok(true) permits attachment. This operation must not mutate or truncate durable state.

Reimplemented in pulp::timeline::FileJournal.


The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/timeline/include/pulp/timeline/journal.hpp