Search documentation of Finitomata

# View Source Finitomata.ClusterInfo behaviour (Finitomata v0.22.1)

The behaviour to be implemented for locating the node across the cluster.

`Infinitomata` comes with a default naïve implementation, which simply responds with a determined random value for `whois/1` and with all visible nodes list for `nodes/0`.

The call to `Finitomata.ClusterInfo.init/1` passing the module implementing the desired behaviour is mandatory before any call to `Infinitomata.start_fsm/4` to preserve a determined consistency.

# Summary

## Callbacks

nodes()

Returns nodes available to select from

whois(id)

Returns the node “selected” for this particular `id`

## Functions

init(impl)

Call this function to select an implementation of a cluster lookup

nodes()

Delegates to the selected implementation of a cluster lookup

whois(id)

Delegates to the selected implementation of a cluster lookup

# Callbacks

Link to this callback

# nodes()

View Source

    @callback nodes() :: [node()]

Returns nodes available to select from

Link to this callback

# whois(id)

View Source

    @callback whois(id :: term()) :: node() | nil

Returns the node “selected” for this particular `id`

# Functions

Link to this function

# init(impl)

View Source

Call this function to select an implementation of a cluster lookup

Link to this function

# nodes()

View Source

Delegates to the selected implementation of a cluster lookup

Link to this function

# whois(id)

View Source

Delegates to the selected implementation of a cluster lookup