IPC types & channel setup #6
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#6
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 developer wiring the app crate, I want clearly defined IPC types (
AppCommand,AppEvent,TerminalCommand,GitCommand) and a factory for creating the tokio channel pair (mpsc + broadcast), so that the frontend and backend can communicate without network sockets.Acceptance criteria
IPC types (
backend/src/ipc.rs)AppCommandenum with variants:Orchestration(OrchestrationCommand),Terminal(TerminalCommand),Git(GitCommand),Settings(SettingsCommand)AppEventenum with variants:DomainEvent(StoredEvent),TerminalOutput { terminal_id, data: Vec<u8> },TerminalSnapshot { terminal_id, history: Vec<u8> },GitStatus { project_path, status },Error { context, message }TerminalCommandenum:Open,Write,Resize,Close,Restart— all with fields matching spec §6.1GitCommandenum:GetStatus,GetDiff,GetBranches,GetLog— all with fields matching spec §6.1SettingsCommandplaceholder (at minimum anUpdateConfigvariant)Channel factory (
IpcChannels)IpcChannelsstruct holding:command_tx: mpsc::Sender<AppCommand>,command_rx: mpsc::Receiver<AppCommand>,event_tx: broadcast::Sender<AppEvent>,event_rx: broadcast::Receiver<AppEvent>IpcChannels::new(cmd_buffer: usize, evt_buffer: usize) -> SelffactoryAppCommandandAppEventtypes implementDebug + Clone + SendIpcClient (
frontend/src/ipc_client.rs)IpcClientstruct wrappingmpsc::Sender<AppCommand>andbroadcast::Receiver<AppEvent>send(&self, cmd: AppCommand) -> Result<(), IpcError>— async sendnext_event(&self) -> Result<AppEvent, IpcError>— async receiveIpcClientisClone-able (sender clones, receiver subscribes to broadcast)Tests
Out of scope
References
Dependencies
issue-4-event-sourcing