quic_discovery_static (quic v1.3.1)
View SourceStatic node discovery backend.
This backend uses a static list of nodes configured in the application environment or vm.args.
Configuration
In sys.config:
{quic, [
{dist, [
{discovery_module, quic_discovery_static},
{nodes, [
{'node1@host1', {"192.168.1.1", 4433}},
{'node2@host2', {"192.168.1.2", 4433}}
]}
]}
]}In vm.args:
-quic_dist nodes [{'node1@host1',{"192.168.1.1",4433}}]
Summary
Functions
Initialize the static discovery backend.
List all known nodes.
Look up a node's address.
Register a node with its address directly. This is a simplified API for manual registration during testing or when you need to add a node outside of the behaviour callback. Address can be {IP, Port} where IP is a tuple or string.
Register a node in the static table. This allows runtime updates to the node list.
Unregister a node.
Functions
-spec init(Opts :: proplists:proplist() | map()) -> {ok, map()}.
Initialize the static discovery backend.
-spec list_nodes(Host :: string()) -> {ok, [{atom(), inet:port_number()}]}.
List all known nodes.
-spec lookup(NodeName :: atom(), Host :: string()) -> {ok, {inet:ip_address() | string(), inet:port_number()}} | {error, not_found}.
Look up a node's address.
-spec register(NodeName :: atom(), Address :: {inet:ip_address() | string(), inet:port_number()}) -> ok.
Register a node with its address directly. This is a simplified API for manual registration during testing or when you need to add a node outside of the behaviour callback. Address can be {IP, Port} where IP is a tuple or string.
-spec register(NodeName :: atom(), Port :: inet:port_number(), State :: map()) -> {ok, map()}.
Register a node in the static table. This allows runtime updates to the node list.
-spec unregister(NodeName :: atom()) -> ok.
Unregister a node.