Runbox.Slave (runbox v1.2.0)

Utilities for starting a slave node with a scenario release and communicating with the node.

Link to this section Summary

Functions

Calls a function on the slave.

Starts a slave node.

Spawns a slave and executes the fun.

Link to this section Functions

Link to this function

call(slave, m, f, a)

@spec call(node(), module(), atom(), list()) :: term()

Calls a function on the slave.

Calls MFA on the slave. See :erpc.call/4 for details.

Link to this function

start(release_dir, app_env \\ [])

@spec start(String.t(), [
  {Application.app(), [{Application.key(), Application.value()}]}
]) ::
  {:ok, node()} | {:error, term()}

Starts a slave node.

The release_dir is a directory with scenario release.

If app_env is set, given app environment variables are set on slave.

Link to this function

with_slave(release_dir, fun)

@spec with_slave(String.t(), (node() -> result)) :: {:ok, result} | {:error, term()}
when result: any()

Spawns a slave and executes the fun.

fun recives the slave node as a parameter. The slave is terminated after the fun finishes.