feat: event-driven projector, connection pooling, async writes, handler registration, WriteBatch API#29
Merged
johnny-emp merged 4 commits intomainfrom Feb 13, 2026
Merged
Conversation
…andler registration, and WriteBatch API - Event-driven projector: FileEventLog fires tokio::sync::Notify after each append; Projector and EventProcessor await instead of polling, giving near-zero latency with zero idle CPU. - Projection read pool enabled by default (4 connections); add projection_write_conn() for explicit write access. - Native async write API: LmdbCanonicalStore::submit_write() centralizes spawn_blocking + txn lifecycle; convenience wrappers async_put_state and async_del_state. - EventProcessorBuilder::build_with_projection() opens a dedicated connection to the projection DB, removing the need to pass one in. - WriteBatch API for explicit multi-op atomic commits with commit_async support. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FileEventLogfirestokio::sync::Notifyafter each successful append.Projector::run_continuous()andEventProcessor::run()nowawaitthe notification instead of blind-polling, giving near-zero-latency projection with zero CPU waste when idle. Falls back topoll_intervaltimeout as a safety net.ProjectionConfignow creates a 4-connection read pool out of the box. Addedprojection_write_conn()/write_conn()for explicit write access;projection_connection()documented as deprecated.LmdbCanonicalStore::submit_write()centralizesspawn_blocking+ transaction lifecycle into a single closure-based method. Convenience wrappersasync_put_state()andasync_del_state()for common single-op writes. Exposed viaAzothDb::submit_write().EventProcessorBuilder::build_with_projection()opens a dedicated read-write SQLite connection to the projection DB automatically, removing the need for callers to pass one externally.WriteBatchstruct for explicit multi-operation atomic commits withput(),delete(),append_event(),commit(), andcommit_async(). Accessible viadb.write_batch().Test plan
cargo checkpasses across the full workspacecargo test --workspacepasses (all existing tests green, no regressions)