Commit 7b568a5
committed
feat(Common): Implement Transport Registry for dynamic transport selection
This commit introduces the Transport Registry module in the Common crate, enabling dynamic transport selection and management at runtime. The implementation provides:
- `TransportRegistry`: A central registry for managing multiple transport strategies (IPC, gRPC, WASM) with registration, selection, and lifecycle management.
- `TransportSelector`: An auto-selection mechanism that chooses the best transport based on environment, requirements, and constraints using a priority-based scoring system.
- `TransportContext`: Context information encapsulating environment (platform, web/desktop), requirements (streaming, cross-network, performance), and constraints.
- `EnvironmentDetector`: Runtime environment detection for Platform, browser capabilities, and transport availability.
The implementation follows the strategy pattern defined in the Common crate's abstract transport traits. It integrates with existing `TransportStrategy`, `TransportType`, `TransportConfig`, and DTO components. The selector uses a weighted scoring algorithm that considers:
- Environment matches (WASM for web, IPC for desktop)
- Capability requirements (streaming, cross-network)
- Performance levels (Critical, High, Medium, Low)
- Latency constraints
This enables the Land ecosystem to automatically select the optimal transport (IPC for same-machine desktop, gRPC for network/cross-process, WASM for web) based on runtime detection, supporting the cross-platform nature of the editor.1 parent b93d5a9 commit 7b568a5
1 file changed
Lines changed: 908 additions & 0 deletions
0 commit comments