Builds and executes a middleware pipeline for RPC calls.
A pipeline is an ordered list of {plug_module, opts} tuples. Plugs are
composed inside-out — the first plug in the list is the outermost
middleware and the last plug is the innermost.
Default pipeline
[Retry, Logger, NodeSelector, Executor, ErrorHandler]This replicates the behaviour of the original RpcCall.
Summary
Functions
Executes a pipeline by composing the plugs into a chain and calling it with the given context.
Default pipeline that mirrors the original RpcCall behaviour.
Convenience: builds the default pipeline, runs it, and returns the context.
Extracts the final result from a pipeline context.
Convenience: creates a context, runs the pipeline, and extracts the result.
Types
@type t() :: [plug_entry()]
Functions
@spec call(t(), EasyRpc.Context.t()) :: EasyRpc.Context.t()
Executes a pipeline by composing the plugs into a chain and calling it with the given context.
The returned context contains the final state — inspect ctx.result,
ctx.error, and ctx.halted after calling.
@spec default() :: t()
Default pipeline that mirrors the original RpcCall behaviour.
Order (outermost → innermost):
- ErrorHandler — normalises result/error on the context
- Retry — wraps the entire call, re-executes on failure
- NodeSelector — picks a target node
- Logger — logs before and after each attempt
- Executor — calls
:erpc.call
@spec execute(EasyRpc.Context.t()) :: EasyRpc.Context.t()
Convenience: builds the default pipeline, runs it, and returns the context.
@spec extract_result(EasyRpc.Context.t(), EasyRpc.WrapperConfig.t()) :: term()
Extracts the final result from a pipeline context.
Handles both bare mode (raises on error) and safe mode
(returns {:ok, result} | {:error, error}).
@spec run(EasyRpc.WrapperConfig.t(), atom(), list(), t()) :: term()
Convenience: creates a context, runs the pipeline, and extracts the result.
This is the primary entry point used by code-generated wrapper functions.