Files
gitks/actor/server.rs
T
zhenyi c32a7cad2f feat(cluster): implement Raft consensus with tracing and HTTP support
- Add Raft log and snapshot mechanisms for distributed consensus
- Integrate hyper HTTP server and client libraries for network communication
- Enhance tracing capabilities with structured logging and spans
- Add dependency tracking for new consensus-related crates
- Implement snapshot storage with serialization and persistence
- Add remote repository synchronization via Raft commands
- Include comprehensive tracing instrumentation across services
2026-06-10 18:33:42 +08:00

18 lines
677 B
Rust

use crate::actor::handler::start_node_actor;
use crate::actor::message::GitNodeMessage;
use crate::server::GitksService;
use ractor::ActorRef;
use std::path::PathBuf;
pub async fn init_actor_cluster(
service: GitksService,
storage_name: String,
grpc_addr: String,
data_dir: PathBuf,
) -> Result<(ActorRef<GitNodeMessage>, tokio::task::JoinHandle<()>), ractor::SpawnErr> {
tracing::info!(storage_name = %storage_name, grpc_addr = %grpc_addr, "initializing actor cluster");
let result = start_node_actor(service, storage_name.clone(), grpc_addr, data_dir).await?;
tracing::info!(storage_name = %storage_name, "actor cluster ready");
Ok(result)
}