View Source gen_cluster (gen_cluster v0.3.0)

Process that manages calling the necessary discovery and connect/disconnect functions at a configurable interval.

Summary

Types

-type builtin_discovery() ::
          {dns, gc_discover_dns_ip:options() | gc_discover_dns_srv:options()} |
          {static, gc_discover_static:options()} |
          {epmd_all, gc_discover_epmd_all:options()}.
-type cb_state() :: term().
-type config() :: [option()].
-type option() ::
          {discovery, builtin_discovery() | {module(), term()}} |
          {dist, module()} |
          {refresh_interval_ms, integer() | undefined}.
-type peer() :: #{node := atom(), port => inet:port_number()}.
-type peers() :: sets:set(peer()).

Functions

-spec init([config()]) ->
              gen_statem:init_result(inactive | active,
                                     #data{discovery :: {module(), cb_state()},
                                           dist :: {module(), cb_state()},
                                           refresh_interval_ms :: integer() | infinity}).
-spec nodes_to_peers([node()]) -> peers().
Link to this function

start_link(Configuration)

View Source
-spec start_link(config()) -> {ok, pid()} | ignore | {error, term()}.
Link to this function

terminate(Reason, State, Data)

View Source