View Source partisan_peer_discovery_list (partisan v5.0.0-beta.21)

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
               nodes => [
                   <<"192.168.40.1:9000">>,
                   <<"192.168.40.10:9000">>,
                   <<"mynode@192.168.40.100:9000">>,
               ]
           }}
      ]}
  ]}

Link to this section Summary

Link to this section Types

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

Link to this section Functions

-spec init(Opts :: options()) -> {ok, State :: state()} | {error, Reason :: any()}.
-spec lookup(State :: map(), timeout()) ->
          {ok, [bondy_peer_discovery_agent:peer()], NewState :: state()} |
          {error, Reason :: any(), NewState :: state()}.