partisan_peer_discovery_list (partisan v5.0.1)

View Source

An implementation of the partisan_peer_discovery_agent behaviour that uses a static list of node names for service discovery.

It is enabled by using the following options in the sys.conf file

     bash
  {partisan, [
      {peer_discovery, [
           {type, partisan_peer_discovery_list},
           {config, #{
               name => mynode
               addresses => [
                   <<"192.168.40.1:9000">>,
                   <<"192.168.40.10:9000">>,
                   <<"mynode@192.168.40.100:9000">>,
               ]
           }}
      ]}
  ]}

Summary

Types

name/0

-type name() :: atom() | binary() | string().

options/0

-type options() :: #{addresses := [name() | {name(), inet:port_number()}]}.

state/0

-type state() :: #state{peers :: [partisan:node_spec()]}.

Functions

init(Opts)

-spec init(Opts :: options()) -> {ok, State :: state()} | {error, Reason :: any()}.

lookup(State, Timeout)

-spec lookup(State :: state(), timeout()) ->
                {ok, [partisan:node_spec()], NewState :: state()} |
                {error, Reason :: any(), NewState :: state()}.