Expand description
Storage and network adapters for BEAM.
This module contains all adapter implementations that connect the
crate::Node graph engine to external systems:
§Storage Adapters
MemoryStorage— in-memoryHashMap-backed storage (default)RedbStorage— persistent embedded storage viaredb(native only)
§Storage Read/Write Split
Storage adapters that implement [Actor::try_clone_storage] are started
as two actors by the Router: a read actor (receives Get) and a write
actor (receives Put, BatchPut, Flush). Both share the same
underlying store via Arc, so reads see committed writes immediately.
RedbStoragesplits — the write actor’sspawn_blockingfsync no longer blocks the read actor’s concurrentGetqueries.MemoryStoragedoes not split — in-memory writes are synchronous (no fsync), so splitting provides no benefit and would break read-after-write ordering.
§Network Adapters
OutgoingWebsocketManager— outgoing WebSocket client manager (native only)WsServer— incoming WebSocket server with optional TLS (native only)WsConn— per-connection WebSocket actor (native only)Multicast— UDP multicast LAN discovery (native only)- [
WebRtcPeer] — WebRTC data channel P2P connection (feature-gated)
§Adapter Protocol
All adapters implement the crate::actor::Actor trait and receive
[crate::message::Message] via the actor system. Storage adapters
handle Get, Put, BatchPut, and Flush. Network adapters
handle Put and Get by serializing to the wire format and
forwarding to remote peers.
Structs§
- Memory
Storage - In-memory storage adapter backed by
HashMap<String, Children>. - Multicast
- UDP multicast adapter for LAN peer discovery and sync.
- Outgoing
Websocket Manager - Manages outbound WebSocket connections to relay servers.
- Redb
Storage - redb-backed persistent storage adapter for BEAM.
- WsConn
- A per-connection WebSocket actor that bridges Gun protocol messages.
- WsServer
- WebSocket server adapter that accepts inbound connections.
- WsServer
Config - Configuration for the
WsServeradapter.