All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[1.1.0]
Added
- Plug pipeline system — Phoenix-style middleware architecture for RPC calls
EasyRpc.Context— context struct flowing through the pipeline (likePlug.Conn)EasyRpc.Plug— behaviour for custom middleware plugsEasyRpc.Pipeline— pipeline builder and executor with default pipelineEasyRpc.Plugs.NodeSelector— node selection plugEasyRpc.Plugs.Executor—:erpc.callplugEasyRpc.Plugs.Retry— retry logic plugEasyRpc.Plugs.Logger— structured logging plugEasyRpc.Plugs.ErrorHandler— result/error normalisation plugEasyRpc.Plugs.Telemetry— telemetry events plug (optional)EasyRpc.Plugs.Cache— ETS-based caching plug (example)
- Custom pipeline DSL —
pipeline do ... endsection withplugentities- When
pipelineis defined, generated functions usePipeline.run/4 - When no
pipelineis defined, originalRpcCall.executebehaviour is preserved
- When
- Added
:telemetryas optional dependency - Added
enable_loggingoption to config section for controlling detailed logging - Added
nodes_provideroption for dynamic node discovery via MFA - Added
EasyRpc.NodeSelector.select_node_safe/2— non-raising node selection, shared byRpcCalland theNodeSelectorplug
Changed
- Updated documentation to reflect Spark DSL syntax (replacing old
defrpcmacro references) - Improved error handling documentation with clearer examples
- Per-function options passed to
defrpcare now validated at compile time — unknown keys (e.g. a misspelledretry) raiseEasyRpc.Errorinstead of being silently ignored;EasyRpc.RpcWrapperapplies the same validation for consistent error messages - The default plug pipeline is pre-composed at compile time; running an RPC no longer rebuilds the closure chain per call
EasyRpc.Plugs.Telemetrygates on:telemetryavailability at compile time, removing per-call rescue overhead when the optional dependency is absent
Fixed
- Fixed inconsistencies between README examples and actual Spark DSL syntax
- Corrected documented
pipelineplug option syntax — Spark rejects bare keyword options likeplug MyCachePlug, ttl: 5_000; plug options must be passed asplug MyCachePlug, opts: [ttl: 5_000](README andEasyRpc.Plugs.Cacheexamples updated) - Fixed failing doctest for
EasyRpc.version/0(pinned a stale version) WrapperConfig.load_config!/2andload_from_options!/1now honour the:enable_loggingoption (previously silently dropped)- Dynamic node providers returning non-atom values now fail fast with a clear
%EasyRpc.Error{}instead of reaching:erpc.callwith an invalid node name - In safe mode (
error_handling/retry), short-circuited results (e.g. cache hits) are wrapped consistently byErrorHandler, so callers always see{:ok, result} | {:error, error}regardless of pipeline path - Halted contexts are no longer retried by
EasyRpc.Plugs.Retry— halting means "stop the pipeline", so retrying only burned the sleep time
[0.9.0] - 2024-01-15
Added
- Migrated from macro-based DSL to Spark DSL for better extensibility
- Added
rpc_functionentities with support for argument names (better IDE support) - Added
private: trueoption to generate private functions (defp) - Added
new_nameoption to create function aliases - Added comprehensive architecture documentation in
guides/ARCHITECTURE.md - Added support for
:infinitytimeout
Changed
- BREAKING: Replaced
defrpcmacro withrpc_functionin Spark DSL - BREAKING: Replaced
config :my_app, :apiwithconfig do...endblocks - Improved error handling with unified
EasyRpc.Errorstruct - Enhanced node selection strategies with better documentation
Deprecated
- Old macro style (
use EasyRpc.RpcWrapper) - still works but not recommended
Removed
- Removed deprecated
DefRpcmodule (replaced by Spark DSL)
0.7.0 - 2023-12-01
Added
- Added
sleep_before_retryoption for retry delay control - Added benchmark suite for performance comparison
- Added telemetry events for RPC calls
Changed
- Improved retry logic to automatically enable error_handling
- Better error messages with context details
Fixed
- Fixed sticky node not working with round_robin strategy
- Fixed timeout not being applied correctly in some edge cases
0.6.0 - 2023-10-15
Added
- Initial release with basic RPC wrapping functionality
- Support for random, round_robin, and hash node selection
- Basic retry and timeout support
- Error handling with raise or {:ok, result} tuples