Beethoven.Utils (Beethoven v0.2.7)

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.

Gets an environmental variable from beethoven's application config

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.

Functions

backoff(max \\ 20, delta \\ 0, multiplier \\ 1)

@spec backoff(integer(), integer(), integer()) :: :ok

Performs a backoff wait to void race conditions in a distributed environment. (:rand.uniform(1..max) + delta) * multiplier

backoff_n(name, max \\ 20, delta \\ 0, multiplier \\ 1)

@spec backoff_n(atom(), integer(), integer(), integer()) :: :ok

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

get_app_env(envVar, default \\ nil)

Gets an environmental variable from beethoven's application config

monitor_all_nodes(mode)

@spec monitor_all_nodes(boolean()) :: :ok

Toggles the monitoring status of all nodes in the cluster.

monitor_node(nodeName, mode)

@spec monitor_node(node(), boolean()) :: :ok

Toggles the monitoring status of another node in the cluster.

remote_call(fun, host, timeout \\ 1000)

@spec remote_call((-> any()), node(), integer()) :: any() | {:error, :timeout}

Fn to simplify calling named Processes on other nodes... and getting a call back.