Wobserver v0.1.3 Wobserver.Util.Node.Discovery

Helps discovering other nodes to connect to.

The method used can be set in the config file by setting:

config :wobserver,
  discovery: :dns,

The following methods can be used: (default: :none)

  • :none, just returns the local node.
  • :dns, use DNS to search for other nodes. The option discovery_search needs to be set to filter entries.
  • :custom, a function as String.

Example config

No discovery: (is default)

config :wobserver,
  port: 80,
  discovery: :none

Using dns as discovery service:

config :wobserver,
  port: 80,
  discovery: :dns,
  discovery_search: "google.nl"

Using a custom function:

config :wobserver,
  port: 80,
  discovery: :custom,
  discovery_search: &MyApp.CustomDiscovery.discover/0

Using a anonymous function:

config :wobserver,
  port: 80,
  discovery: :custom,
  discovery_search: fn -> [] end

Summary

Functions

Discovers other nodes to connect to

Searches for a node in the discovered nodes

Functions

discover()

Discovers other nodes to connect to.

The method used can be set in the config file by setting:

config :wobserver,
  discovery: :dns,

The following methods can be used: (default: :none)

  • :none, just returns the local node.
  • :dns, use DNS to search for other nodes. The option discovery_search needs to be set to filter entries.
  • :custom, a function as String.

Example config

No discovery: (is default)

config :wobserver,
  discovery: :none

Using dns:

config :wobserver,
  discovery: :dns,
  discovery_search: "google.nl"

Using a custom function:

config :wobserver,
  discovery: :custom,
  discovery_search: "&MyApp.CustomDiscovery.discover/0"
find(search)
find(String.t) ::
  :local |
  :unknown |
  {:remote, Wobserver.Util.Node.Remote.t}

Searches for a node in the discovered nodes.

local()