Decentralised Art Server
High-performance C++ backend that exposes HTML interface and a secure REST API for managing Performative Transactions entities
Loading...
Searching...
No Matches
dcn::feed::FeedProjector Class Referencefinal

Materialises change-log rows from the events hot-store into the Feed database, using an independent change_seq cursor persisted in the feed DB. Implements events::IEventProjector so it can be driven by the existing EventsRuntime projection loop. More...

#include <feed_projector.hpp>

Inheritance diagram for dcn::feed::FeedProjector:
dcn::events::IEventProjector

Public Member Functions

 FeedProjector (events::SQLiteHotStore &store, Feed &feed, const asio::strand< asio::io_context::executor_type > &write_strand, events::ProjectorRetryConfig retry={})
std::string_view id () const override
std::int64_t cursor () const override
asio::awaitable< std::size_t > projectBatch (std::size_t limit, std::int64_t now_ms) override
Public Member Functions inherited from dcn::events::IEventProjector
virtual ~IEventProjector ()=default

Detailed Description

Materialises change-log rows from the events hot-store into the Feed database, using an independent change_seq cursor persisted in the feed DB. Implements events::IEventProjector so it can be driven by the existing EventsRuntime projection loop.

Cursor policy:

Failure policy (per applyChange):

  • on failure the cursor is left before the row and the row is retried on subsequent projectBatch passes, so transient failures (e.g. busy feed DB) heal on their own. After ProjectorRetryConfig::max_attempts consecutive failing passes the row is dead-lettered (FEED_DEAD_LETTER_BIT in the hot store) and the cursor advances past it: a permanently parked cursor would freeze the prune watermark for every projector and grow the hot store without bound. Dead-lettered rows are exempt from pruning, so no chain event data is lost; a periodic idle-time sweep (ProjectorRetryConfig::sweep_interval_ms) retries them and clears the bit once applyChange succeeds. If the dead-letter mark itself cannot be written, the cursor stays parked.

Constructor & Destructor Documentation

◆ FeedProjector()

dcn::feed::FeedProjector::FeedProjector ( events::SQLiteHotStore & store,
Feed & feed,
const asio::strand< asio::io_context::executor_type > & write_strand,
events::ProjectorRetryConfig retry = {} )

Member Function Documentation

◆ cursor()

std::int64_t dcn::feed::FeedProjector::cursor ( ) const
inlineoverridevirtual

◆ id()

std::string_view dcn::feed::FeedProjector::id ( ) const
overridevirtual

◆ projectBatch()

asio::awaitable< std::size_t > dcn::feed::FeedProjector::projectBatch ( std::size_t limit,
std::int64_t now_ms )
overridevirtual

The documentation for this class was generated from the following files: