feat(server): broker agent for inter-actor coordination
Some checks failed
ci/woodpecker/push/server-vet Pipeline failed
ci/woodpecker/push/server-audit Pipeline was successful
ci/woodpecker/push/server-lint Pipeline failed
ci/woodpecker/push/server-test Pipeline was successful

This commit is contained in:
hdbg
2026-03-01 11:35:06 +01:00
parent 4beb34764d
commit cb05407bb6
13 changed files with 185 additions and 54 deletions

View File

@@ -3,14 +3,15 @@ use miette::Diagnostic;
use thiserror::Error;
use crate::{
actors::{bootstrap::Bootstrapper, keyholder::KeyHolder},
actors::{bootstrap::Bootstrapper, keyholder::KeyHolder, router::MessageRouter},
db,
};
pub mod bootstrap;
pub mod client;
pub mod router;
pub mod keyholder;
pub mod user_agent;
pub mod client;
#[derive(Error, Debug, Diagnostic)]
pub enum SpawnError {
@@ -28,6 +29,7 @@ pub enum SpawnError {
pub struct GlobalActors {
pub key_holder: ActorRef<KeyHolder>,
pub bootstrapper: ActorRef<Bootstrapper>,
pub router: ActorRef<MessageRouter>,
}
impl GlobalActors {
@@ -35,6 +37,7 @@ impl GlobalActors {
Ok(Self {
bootstrapper: Bootstrapper::spawn(Bootstrapper::new(&db).await?),
key_holder: KeyHolder::spawn(KeyHolder::new(db.clone()).await?),
router: MessageRouter::spawn(MessageRouter::default()),
})
}
}