1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! RPC protocol definitions using tarpc.
//!
//! This module implements the tarpc-based RPC layer for
//! inter-node communication including:
//! - Service definitions for colony operations
//! - Client and server implementations
//! - Connection pooling and retry logic
//!
//! # Architecture
//!
//! The RPC layer consists of three main components:
//!
//! - **Protocol**: Trait definitions for `ShardService` and `CoordinatorService`
//! - **Server**: Server implementations that wrap local components
//! - **Client**: Client utilities including connection pooling
//!
//! # Example: Starting a Shard Server
//!
//! ```rust,ignore
//! use phago_distributed::rpc::server::ShardServer;
//! use phago_distributed::shard::ShardedColony;
//!
//! let shard = Arc::new(RwLock::new(ShardedColony::new(...)));
//! let server = ShardServer::new(shard);
//! server.serve("127.0.0.1:8080".parse().unwrap()).await?;
//! ```
//!
//! # Example: Connecting as a Client
//!
//! ```rust,ignore
//! use phago_distributed::rpc::client::{connect_to_shard, ShardClientPool};
//!
//! // Direct connection
//! let client = connect_to_shard("127.0.0.1:8080".parse().unwrap()).await?;
//!
//! // Or use the connection pool
//! let pool = ShardClientPool::new();
//! pool.register_shard(ShardId::new(0), "127.0.0.1:8080".parse().unwrap());
//! let client = pool.get_client(ShardId::new(0)).await?;
//! ```
// Protocol exports
pub use ;
// Message exports
pub use ;
// Client exports
pub use ;
// Server exports
pub use ;