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 implement- [
Registry::TransportRegistry] - Dynamic transport selection and management UnifiedRequest/UnifiedResponse- Common message formatTransportError- Unified error taxonomyTransportConfig- Configuration structures
§Sub-modules
Common- Shared types and utilities- [
gRPC] - gRPC transport implementation - [
IPC] - IPC (Unix sockets/Named pipes) implementation - [
WASM] - WebAssembly/WebWorker implementation - [
Registry] - Transport registry and selection - [
Metrics] - Metrics collection and monitoring - [
Retry] - Retry strategies with backoff - [
CircuitBreaker] - Circuit breaker pattern - [
DTO] - 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§
- Common
- Transport Common Types
- Transport
Config - TransportConfig
- Transport
Error - TransportError
- Transport
Strategy - TransportStrategy Trait
- Unified
Request - UnifiedRequest
- Unified
Response - UnifiedResponse