Skip to main content

Module adapters

Module adapters 

Source
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

§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.

  • RedbStorage splits — the write actor’s spawn_blocking fsync no longer blocks the read actor’s concurrent Get queries.
  • MemoryStorage does 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
  • WsServer — incoming WebSocket server with optional TLS
  • WsConn — per-connection WebSocket actor (used by both client and server)
  • Multicast — UDP multicast LAN discovery
  • [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§

MemoryStorage
In-memory storage adapter backed by HashMap<String, Children>.
Multicast
UDP multicast adapter for LAN peer discovery and sync.
OutgoingWebsocketManager
Manages outbound WebSocket connections to relay servers.
RedbStorage
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.
WsServerConfig
Configuration for the WsServer adapter.