hive-c0re: in-memory broker + per-agent sockets + coordinator state
This commit is contained in:
parent
4545c08908
commit
d79b5a39a1
6 changed files with 220 additions and 9 deletions
|
|
@ -1,13 +1,19 @@
|
|||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
|
||||
use anyhow::{Result, bail};
|
||||
use clap::{Parser, Subcommand};
|
||||
use hive_sh4re::{HostRequest, HostResponse};
|
||||
|
||||
mod agent_server;
|
||||
mod broker;
|
||||
mod client;
|
||||
mod coordinator;
|
||||
mod lifecycle;
|
||||
mod server;
|
||||
|
||||
use coordinator::Coordinator;
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(name = "hive-c0re", about = "hyperhive coordinator daemon and CLI")]
|
||||
struct Cli {
|
||||
|
|
@ -48,7 +54,10 @@ async fn main() -> Result<()> {
|
|||
|
||||
let cli = Cli::parse();
|
||||
match cli.cmd {
|
||||
Cmd::Serve { agent_flake } => server::serve(&cli.socket, &agent_flake).await,
|
||||
Cmd::Serve { agent_flake } => {
|
||||
let coord = Arc::new(Coordinator::new());
|
||||
server::serve(&cli.socket, &agent_flake, coord).await
|
||||
}
|
||||
Cmd::Spawn { name } => {
|
||||
render(client::request(&cli.socket, HostRequest::Spawn { name }).await?)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue