Skip to main content

Module Transport

Module Transport 

Source
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

§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
TransportConfig
TransportConfig
TransportError
TransportError
TransportStrategy
TransportStrategy Trait
UnifiedRequest
UnifiedRequest
UnifiedResponse
UnifiedResponse