Core module for executing remote procedure calls.
Handles RPC execution with:
- Configurable error handling (tuple vs. raise)
- Automatic retries with per-attempt logging
- Node selection via
NodeSelector - Timeout management via
:erpc - Detailed structured logging at every stage
Implements EasyRpc.Behaviours.RpcExecutor.
Examples
config = WrapperConfig.new!(node_selector, RemoteModule, 5_000, 3, true)
{:ok, result} = EasyRpc.RpcCall.execute(config, :get_data, ["key"])
{:error, reason} = EasyRpc.RpcCall.execute(config, :missing_fn, [])
Summary
Functions
Executes an RPC call using the given WrapperConfig.
Executes with a dynamically resolved NodeSelector.
Executes an RPC call with automatic retry. Always uses error handling.
Backward-compatible alias for execute/3.
Backward-compatible alias for execute_dynamic/4.
Types
Functions
@spec execute(EasyRpc.WrapperConfig.t(), function_name(), args()) :: result() | raw_result()
Executes an RPC call using the given WrapperConfig.
Delegates to error-handling or bare execution based on
config.error_handling and config.retry.
Returns {:ok, result} | {:error, Error.t()} with error handling,
or the raw result (raising on failure) without.
@spec execute_dynamic( EasyRpc.WrapperConfig.t(), config_ref(), function_name(), args() ) :: result() | raw_result()
Executes with a dynamically resolved NodeSelector.
Loads the node selector at call-time from {app, config_name} rather than
compile-time. Useful when cluster topology changes at runtime.
@spec execute_with_retry(EasyRpc.WrapperConfig.t(), function_name(), args()) :: result()
Executes an RPC call with automatic retry. Always uses error handling.
Returns {:ok, result} | {:error, Error.t()}.
@spec rpc_call( EasyRpc.WrapperConfig.t(), {function_name(), args()} ) :: result() | raw_result()
Backward-compatible alias for execute/3.
@spec rpc_call_dynamic( EasyRpc.WrapperConfig.t(), config_ref(), {function_name(), args()} ) :: result() | raw_result()
Backward-compatible alias for execute_dynamic/4.