Beethoven.Utils (Beethoven v0.2.3)
Module for generic utilities.
Summary
Functions
Performs a backoff wait to void race conditions in a distributed environment. (:rand.uniform(1 - max) + delta) * multiplier
The same as backoff/3
but shows the calling service's name in the verbose output.
Copies desired table to local node memory.
Gets an environmental variable from beethoven's application config
Retrieves roles from config and converts to map.
Check if Mnesia table exists
Toggles the monitoring status of all nodes in the cluster.
Toggles the monitoring status of another node in the cluster.
Fn to simplify calling named Processes on other nodes... and getting a call back.
Creates a map from a list of maps. First element of the map needs to be an atom. This same atom will be the key for the rest of the data in the map.
Runs a job within a synchronous transaction
Functions
Performs a backoff wait to void race conditions in a distributed environment. (:rand.uniform(1 - max) + delta) * multiplier
The same as backoff/3
but shows the calling service's name in the verbose output.
Performs a backoff wait to void race conditions in a distributed environment. (:rand.uniform(1 - max) + delta) * multiplier
Copies desired table to local node memory.
- Table must already exist in the cluster.
- If the table was initialized on this node, the table is already in memory.
- If node successfully joined in the past, but power-cycled, rebooting will automatically grab the tables from the cluster.
Gets an environmental variable from beethoven's application config
@spec get_role_config() :: map()
Retrieves roles from config and converts to map.
Check if Mnesia table exists
@spec monitor_all_nodes(boolean()) :: :ok
Toggles the monitoring status of all nodes in the cluster.
Toggles the monitoring status of another node in the cluster.
Fn to simplify calling named Processes on other nodes... and getting a call back.
Creates a map from a list of maps. First element of the map needs to be an atom. This same atom will be the key for the rest of the data in the map.
@spec sync_run((-> :ok)) :: {:atomics, :ok} | {:error, any()}
Runs a job within a synchronous transaction