View Source API Reference gen_cluster v0.3.0

Modules

Behaviour to implement to build a method for discovery nodes to connect to.

Utility functions for working with DNS related types and options.

Discovery method that takes a host name to query DNS A records for and uses all the returned hosts as peers to connect or reconnect to. Whether to use the IP or the hostname associated with each IP result is configured with the option host_type which takes ip or hostname as values. The default is ip which uses the IP as is in the node name. When it is hostname each returned IP is passed to inet_res:gethostbyaddr/1 to get a hostname for the address.

Discovery method that takes a host name to query DNS SRV records for and uses all the returned hosts as peers to connect or reconnect to. Whether to use the hostname or IP for each hostname result is configured with the option host_type which takes hostname or ip as values. The default is hostname which keeps the result as is in the node name. When it is ip each returned hostname is passed to inet_res:getbyname/3 to get an IP.

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.

Discovery method that takes a list of hosts to connect to and to reconnect to if a connect is lost. Reconnection can be disabled by including the option refresh_interval_ms => infinity when starting gen_cluster.

Behaviour to implement to build a new method for connecting nodes into a cluster.

The default implementation of gc_dist that uses Erlang distribution for returning the current peers (nodes), connecting to a peer (node) or disconnecting from a peer (node).

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

Application module which runs the top level gen_cluster_sup when started.

Top level supervisor of gen_cluster which starts a gen_cluster process if there is a non-empty gen_cluster application configuration.