c32a7cad2f
- 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
18 lines
677 B
Rust
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)
|
|
}
|