Expand description
§Transport Layer
This module defines the transport-layer abstraction that enables communication between CodeEditorLand components through various mechanisms (gRPC, IPC, WASM) using a unified Strategy pattern interface.
§Architecture
TransportStrategy- Core trait all transports must implementRegistry::TransportRegistry- Dynamic transport selection and managementUnifiedRequest/UnifiedResponse- Common message formatTransportError- Unified error taxonomyTransportConfig- Configuration structures
§Sub-modules
Common- Shared types and utilitiesgRPC- gRPC transport implementationIPC- IPC (Unix sockets/Named pipes) implementationWASM- WebAssembly/WebWorker implementationRegistry- Transport registry and selectionMetrics- Metrics collection and monitoringRetry- Retry strategies with backoffCircuitBreaker- Circuit breaker patternDTO- Data Transfer Objects
§Usage
Components should use the transport abstraction to remain transport-agnostic:
use common_common::transport::{TransportStrategy, UnifiedRequest};
async fn send_request(
transport:&mut dyn TransportStrategy,
method:&str,
payload:Vec<u8>,
) -> Result<Vec<u8>, TransportError> {
let request = UnifiedRequest::new(method, payload);
let response = transport.send_request(request).await?;
Ok(response.payload)
}Modules§
- Circuit
Breaker - Circuit Breaker Pattern
- Common
- Transport Common Types
- DTO
- Transport DTOs
- IPC
- IPC Transport Implementation
- Metrics
- Transport Metrics
- Registry
- Transport Registry
- Retry
- Retry Strategies
- Transport
Config - TransportConfig
- Transport
Error - TransportError
- Transport
Strategy - TransportStrategy Trait
- Unified
Request - UnifiedRequest
- Unified
Response - UnifiedResponse
- WASM
- WASM Transport Implementation
- gRPC
- gRPC Transport Implementation