| Crates.io | moonpool-transport |
| lib.rs | moonpool-transport |
| version | 0.3.0 |
| created_at | 2025-12-03 17:03:46.426638+00 |
| updated_at | 2026-01-25 12:47:05.747118+00 |
| description | FDB-style transport layer for the moonpool framework |
| homepage | |
| repository | https://github.com/PierreZ/moonpool |
| max_upload_size | |
| id | 1964579 |
| size | 430,780 |
FDB-style transport layer for the moonpool simulation framework.
Networking primitives that work identically in simulation and production. Your application code doesn't change—only the provider implementation does.
This follows FoundationDB's FlowTransport patterns, where the same fdbserver code runs in both real deployments and the simulator.
The transport layer depends on NetworkProvider and TimeProvider traits from moonpool-core:
| Environment | NetworkProvider | TimeProvider |
|---|---|---|
| Production | TokioNetworkProvider |
TokioTimeProvider |
| Simulation | SimNetworkProvider |
SimTimeProvider |
Build your transport once with provider traits. In production, inject tokio-based providers for real TCP. In simulation, inject sim providers that route through the deterministic event loop.
Request/Response with Correlation: Every request gets a unique correlation ID. Responses are routed back to the correct waiting caller.
Automatic Reconnection: When connections drop, peers reconnect with exponential backoff. Messages queue during disconnection and drain when connectivity returns.
Message Queuing: The transport buffers outbound messages during network failures rather than failing immediately. This matches real-world patterns where brief outages shouldn't cause application errors.
┌─────────────────────────────────────────────────┐
│ Application Code │
│ Uses NetTransport + RPC │
├─────────────────────────────────────────────────┤
│ NetTransport (endpoint routing) │
│ • Multiplexes connections per endpoint │
│ • Request/response with correlation │
├─────────────────────────────────────────────────┤
│ Peer (connection management) │
│ • Automatic reconnection with backoff │
│ • Message queuing during disconnection │
├─────────────────────────────────────────────────┤
│ Wire Format (serialization) │
│ • Length-prefixed packets │
│ • CRC32C checksums │
└─────────────────────────────────────────────────┘
Apache 2.0