# `DalaDev.Remote.Rpc`
[🔗](https://github.com/manhvu/dala_dev/blob/main/lib/dala_dev/remote.ex#L470)

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}

# `call`

```elixir
@spec call(module(), atom(), [term()], keyword()) :: {:ok, term()} | {:error, term()}
```

Calls a function on the selected remote node.

## Parameters

- `module` - The module containing the function
- `function` - The function name (atom)
- `args` - List of arguments to pass to the function
- `opts` - 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}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
