OrchestrationEngine — dispatch loop & reactor framework #7
Labels
No labels
area:config
area:contracts
area:engine
area:eventsourcing
area:frontend
area:git
area:ipc
area:persistence
area:provider
area:scaffold
area:terminal
type:user-story
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/peon#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story
As a backend developer, I want an
OrchestrationEnginethat receives commands, runs them through the Decider, persists resulting events via the EventStore, updates the in-memory read model, and broadcasts events to reactors and the frontend, so that the entire CQRS pipeline is wired together.Acceptance criteria
OrchestrationEngine (
engine.rs)Arc<EventStore>,Arc<RwLock<OrchestrationReadModel>>,broadcast::Sender<StoredEvent>,Vec<Box<dyn Reactor>>dispatch(&self, command: OrchestrationCommand) -> Result<(), EngineError>that executes the full pipeline:decide(command, model)(pure, sync)event_store.append_all()project()foldread_model(&self) -> OrchestrationReadModel— returns a clone of current stateEngineErrorenum wrappingDeciderErrorandPersistenceErrorReactor trait
#[async_trait] trait Reactor: Send + Syncwithasync fn on_event(&self, event: &StoredEvent, engine: &OrchestrationEngine)Startup replay
OrchestrationEngine::new()replays all events from EventStore to rebuild the read model before accepting commandsBackend command loop (
backend::start())pub async fn start(command_rx: mpsc::Receiver<AppCommand>, event_tx: broadcast::Sender<AppEvent>)entry pointcommand_rx.recv(), routesAppCommand::Orchestrationto engine dispatchStoredEventintoAppEvent::DomainEventbefore broadcasting to frontendAppCommand::Terminalto TerminalManager,AppCommand::Gitto GitManager (stubs for now)Tests
Out of scope
References
Dependencies
issue-6-ipcand cherry-pick fromissue-5-sqlite