Raxol.Swarm.CommsManager
(Raxol v2.3.0)
View Source
Bandwidth-aware synchronization manager.
Monitors link quality per node and adapts sync frequency. Routes messages through priority queues, dropping low-priority traffic on degraded links. Critical messages are always sent immediately.
Summary
Functions
Returns a specification to start this module under a supervisor.
Returns all links and their quality.
Returns the current link quality for a node.
Mark a node as disconnected.
Send a message to a remote node with the given priority.
Update link quality based on health data from NodeMonitor.
Types
@type link_info() :: %{ quality: link_quality(), rtt_ms: float(), last_ping: integer(), messages_sent: non_neg_integer(), messages_dropped: non_neg_integer() }
@type link_quality() :: :excellent | :good | :degraded | :poor | :disconnected
@type priority() :: :critical | :high | :normal | :low
@type t() :: %Raxol.Swarm.CommsManager{ flush_interval_ms: pos_integer(), flush_ref: reference() | nil, links: %{required(node()) => link_info()}, node_monitor: GenServer.server(), queues: %{required(node()) => :queue.queue()} }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec get_all_links(GenServer.server()) :: %{required(node()) => link_quality()}
Returns all links and their quality.
@spec get_link_quality(GenServer.server(), node()) :: link_quality()
Returns the current link quality for a node.
@spec mark_disconnected(GenServer.server(), node()) :: :ok
Mark a node as disconnected.
@spec send_msg(GenServer.server(), node(), term(), priority()) :: :ok | {:error, :disconnected}
Send a message to a remote node with the given priority.
@spec start_link(keyword()) :: GenServer.on_start()
@spec update_link(GenServer.server(), node(), float()) :: :ok
Update link quality based on health data from NodeMonitor.