partisan_rpc (partisan v6.0.0)
View SourcePartisan's counterpart of Erlang's rpc module.
This is the **legacy** surface. Like OTP — whose own rpc documentation steers new code to erpc:call/4, erpc:multicall/4 and erpc:send_request/4 — prefer partisan_erpc for new code. rpc is kept because it is the target of the rpc => partisan_rpc rewrite applied to modules derived from OTP sources, and because existing code calls it.
Since OTP 23 the rpc module is implemented on top of erpc, with a thin layer translating exceptions into {badrpc, Reason}. This module mirrors that arrangement, and mirrors OTP's split exactly:
call,cast,multicall,async_call/yield/nb_yieldare shims overpartisan_erpc, which runs each request in its own process on the target.block_call,abcast,sbcastandeval_everywherego topartisan_rpc_backend— the counterpart of OTP'srexserver, which OTP likewise still keeps for exactly these operations.block_callin particular is *defined* as executing on that server, serialised with otherblock_calls; that is what distinguishes it fromcall.
Summary
Functions
Evaluates Module:Function(Arguments) on Node, **in the partisan_rpc_backend process itself**.
Resolves the forward_opts() for a call: the caller's options merged over the globally configured forward_options.
Types
-type error_reason() :: timeout | any().
-opaque key()
Functions
Evaluates Module:Function(Arguments) on Node, **in the partisan_rpc_backend process itself**.
Unlike call/4 this is serialised with every other block_call on the target and blocks that server for the duration. That serialisation is the defining semantic of block_call — not an implementation accident — which is why OTP also still routes it through rex rather than through erpc.
-spec call(Node :: node(), Module :: module(), Function :: atom(), Arguments :: [any()], Timeout :: timeout() | partisan_peer_service_manager:forward_opts()) -> Reply :: any() | {badrpc, error_reason()}.
-spec cast(Node :: node(), Module :: module(), Function :: atom(), Arguments :: [any()], Opts :: partisan_peer_service_manager:forward_opts()) -> true.
Resolves the forward_opts() for a call: the caller's options merged over the globally configured forward_options.
**Per-call options win.** The global value only fills in keys the caller did not specify. This previously read partisan_config:get(forward_options, CallerOpts), which inverts the precedence — partisan_config:get/2 returns the *configured* value whenever one is set, so the caller's channel and partition_key were silently discarded as soon as anything set the global. partisan_pluggable_peer_service_manager:forward_message/4 has always merged in this order; this brings RPC in line with it.
-spec yield(key()) -> any() | {badrpc, error_reason()}.