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
Internally uses the plug pipeline system for safe/retry mode,
and direct :erpc.call for bare mode (backward compatible).
See EasyRpc.Pipeline and EasyRpc.Plug for extending behaviour.
Implements EasyRpc.Behaviours.RpcExecutor.
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.
In bare mode (no error_handling, no retry), uses direct :erpc.call for
backward-compatible exception propagation.
In safe/retry mode, uses the plug pipeline.
@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}.
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.