Generic RPC call functions for executing arbitrary functions on remote nodes.
These functions automatically use the node selected via
DalaDev.Remote.select_node/1.
Usage
iex> DalaDev.Remote.Rpc.call(MyModule, :my_function, [arg1, arg2])
{:ok, result}
iex> DalaDev.Remote.Rpc.call(MyModule, :my_function, [arg1, arg2], timeout: 10_000)
{:ok, result}
Summary
Functions
Calls a function on the selected remote node.
Functions
Calls a function on the selected remote node.
Parameters
module- The module containing the functionfunction- The function name (atom)args- List of arguments to pass to the functionopts- Options::timeout- RPC timeout in ms (defaults to remote timeout)
Returns
{:ok, result}on success{:error, reason}on failure
Examples
# Call a function with no arguments
iex> DalaDev.Remote.Rpc.call(MyModule, :get_status, [])
{:ok, :online}
# Call a function with arguments
iex> DalaDev.Remote.Rpc.call(MyModule, :add, [1, 2])
{:ok, 3}
# Call a function with custom timeout
iex> DalaDev.Remote.Rpc.call(MyModule, :slow_function, [], timeout: 30_000)
{:ok, result}