Add local pipe registry commands

This commit is contained in:
Eric Wendland 2026-05-17 20:17:26 +02:00
commit c991825127
13 changed files with 235 additions and 14 deletions

View file

@ -462,9 +462,9 @@ fn request_for_command(command: Command) -> Result<ControlRequest> {
PubsubCommand::Pub { topic, message } => ControlRequest::PubsubPub { topic, message },
PubsubCommand::Sub { topic } => ControlRequest::PubsubSub { topic },
},
Command::Pipe { command } => ControlRequest::ModuleStub {
module: "pipe".to_owned(),
command: format!("{command:?}"),
Command::Pipe { command } => match command {
PipeCommand::Listen { name } => ControlRequest::PipeListen { name },
PipeCommand::Connect { target } => ControlRequest::PipeConnect { target },
},
Command::Db { command } => match command {
DbCommand::Add { name, path } => ControlRequest::DbAdd { name, path },
@ -947,6 +947,18 @@ fn print_response(response: ControlResponse, json: bool) -> Result<()> {
}
println!("note: {note}");
}
ControlResponse::PipeListening { listener } => {
println!("listening pipe: {}", listener.name);
println!("id: {}", listener.id);
println!("listened_at_ms: {}", listener.listened_at.0);
println!("note: {}", listener.note);
}
ControlResponse::PipeConnected { connection } => {
println!("pipe target: {}", connection.target);
println!("local_listener_found: {}", connection.local_listener_found);
println!("connected_at_ms: {}", connection.connected_at.0);
println!("note: {}", connection.note);
}
ControlResponse::NotImplemented { module, command } => {
println!("{module} {command}: not implemented yet");
}