View Source gc_discover_epmd_all (gen_cluster v0.3.0)

Implementation of gc_discover that connects to all nodes found on the same epmd as the one this node is connected to that also has the configured host. The host defaults to the hostname of the current node's node name if no hosts key is given in the options for this module.

Configuration examples

Using the application environment (these config list could also be passed in as an argument to gen_cluster:start_link())

{gen_cluster, [{discover, {epmd_all, #{}}}]}

{gen_cluster, [{discover, {epmd_all, #{hosts => [rosa]}}}]}

Summary

Types

Name of the host to look for nodes on through epmd

Options map to pass configuration for this discover module. Takes an option hosts key with a list of hosts to check for nodes on from the epmd. If hosts is not set in the configuration then the only host checked for through epmd is the host of the current node's node name.

Types

-type host() :: atom() | string() | inet:ip_address().

Name of the host to look for nodes on through epmd

-type options() :: #{hosts => [host()]}.

Options map to pass configuration for this discover module. Takes an option hosts key with a list of hosts to check for nodes on from the epmd. If hosts is not set in the configuration then the only host checked for through epmd is the host of the current node's node name.

Functions

-spec init(options()) -> {ok, #state{hosts :: [host()]}}.
-spec peers(#state{hosts :: [host()]}) -> gen_cluster:peers().