View Source Infinitomata (Finitomata v0.26.4)

The sibling of Finitomata, but runs transparently in the cluster.

If you want to use a stateful consistent hash ring like libring, implement the behaviour Finitomata.ClusterInfo wrapping calls to it and invoke Finitomata.ClusterInfo.init(Impl) before using Infinitomata.start_fsm/4.

The example of such an implementation for libring (assuming the named ring @ring has been started in the supervision tree) follows.

defmodule MyApp.ClusterInfo do
  @moduledoc false
  @behaviour Finitomata.ClusterInfo

  @impl Finitomata.ClusterInfo
  def nodes, do: HashRing.nodes(@ring)

  @impl Finitomata.ClusterInfo
  def whois(id), do: HashRing.key_to_node(@ring, id) 
end

Summary

Functions

Count of children

Returns the random FSM from the pool

Synchronizes the local Infinitomata instance with the cluster

Functions

Link to this function

count(id \\ nil)

View Source (since 0.16.0)

Count of children

Link to this function

random(id \\ nil)

View Source (since 0.18.0)

Returns the random FSM from the pool

Link to this function

start_link(id \\ nil, nodes \\ Node.list())

View Source (since 0.16.0)
Link to this function

synch(id \\ nil)

View Source (since 0.19.0)

Synchronizes the local Infinitomata instance with the cluster