ct_rpc(3erl)
π¦ ct_rpc β Erlang Module Definition π¦
okay so bestie, welcome to ct_rpc β the manual page for the module ct_rpc, straight out of common_test, and it's literally the Common Test specific layer on Erlang/OTP rpc. iykyk. π
β¨ NAME β¨
ct_rpc β Common Test specific layer on Erlang/OTP rpc. that's the whole vibe, no cap.
πΈ DESCRIPTION πΈ
Common Test specific layer on Erlang/OTP rpc. like, that's it, that's the description β it sits on top of Erlang/OTP's rpc and gives it that Common Test glow-up β¨
π EXPORTS π
π app_node(App, Candidates) -> NodeName
Types:
App = atom()
Candidates = [NodeName]
NodeName = atom()
so basically: from a set of candidate nodes, this figures out which one of them is running the application App. icon behavior, truly.
but β plot twist β if none of the candidate nodes is running App, the function makes the test case that's calling this function fail π so like, don't sleep on it.
this one is exactly the same as calling app_node(App, Candidates, true). periodt.
π¦ app_node(App, Candidates, FailOnBadRPC) -> NodeName
Types:
App = atom()
Candidates = [NodeName]
NodeName = atom()
FailOnBadRPC = true | false
same as ct_rpc:app_node/2, except that the argument FailOnBadRPC determines if the search for a candidate node is to stop if badrpc is received at some point. so like, FailOnBadRPC is the main character deciding whether the search keeps going or just taps out π
π app_node(App, Candidates, FailOnBadRPC, Cookie) -> NodeName
Types:
App = atom()
Candidates = [NodeName]
NodeName = atom()
FailOnBadRPC = true | false
Cookie = atom()
same as ct_rpc:app_node/2, except that the argument FailOnBadRPC determines if the search for a candidate node is to stop if badrpc is received at some point. yes bestie, same caveat as before π
and also: the cookie on the client node is set to Cookie for this rpc operation (used to match the server node cookie). so the cookies have to match, it's giving friendship bracelet energy π«Ά
π call(Node, Module, Function, Args) -> term() | {badrpc, Reason}
same as call(Node, Module, Function, Args, infinity). infinity!! we love an unlimited timeout π°οΈβ¨
π₯ call(Node, Module, Function, Args, TimeOut) -> term() | {badrpc, Reason}
Types:
Node = NodeName | {Fun, FunArgs}
Fun = function()
FunArgs = term()
NodeName = atom()
Module = atom()
Function = atom()
Args = [term()]
Reason = timeout | term()
evaluates apply(Module, Function, Args) on the node Node. π§
returns either whatever Function returns, or {badrpc, Reason} if the remote procedure call fails. no in-between, it's giving all or nothing.
and if Node is {Fun, FunArgs}, then applying Fun to FunArgs is to return a node name. cute little indirection moment.
β call(Node, Module, Function, Args, TimeOut, Cookie) -> term() | {badrpc, Reason}
Types:
Node = NodeName | {Fun, FunArgs}
Fun = function()
FunArgs = term()
NodeName = atom()
Module = atom()
Function = atom()
Args = [term()]
Reason = timeout | term()
Cookie = atom()
evaluates apply(Module, Function, Args) on the node Node. same deal as above π«
returns either whatever Function returns, or {badrpc, Reason} if the remote procedure call fails. if Node is {Fun, FunArgs}, applying Fun to FunArgs is to return a node name.
and the extra sprinkle: the cookie on the client node is set to Cookie for this rpc operation (used to match the server node cookie). cookie match = vibe match πͺ
π§ cast(Node, Module, Function, Args) -> ok
Types:
Node = NodeName | {Fun, FunArgs}
Fun = function()
FunArgs = term()
NodeName = atom()
Module = atom()
Function = atom()
Args = [term()]
Reason = timeout | term()
evaluates apply(Module, Function, Args) on the node Node.
no response is delivered and the process that makes the call is not suspended until the evaluation is completed as in the case of call/3,4. like, it just fires it off into the void and keeps it moving π fire-and-forget main character energy.
if Node is {Fun, FunArgs}, applying Fun to FunArgs is to return a node name.
π cast(Node, Module, Function, Args, Cookie) -> ok
Types:
Node = NodeName | {Fun, FunArgs}
Fun = function()
FunArgs = term()
NodeName = atom()
Module = atom()
Function = atom()
Args = [term()]
Reason = timeout | term()
Cookie = atom()
evaluates apply(Module, Function, Args) on the node Node. no response is delivered and the process that makes the call is not suspended until the evaluation is completed as in the case of call/3,4. same silent-queen behavior as cast/4 π
if Node is {Fun, FunArgs}, applying Fun to FunArgs is to return a node name.
and once again: the cookie on the client node is set to Cookie for this rpc operation (used to match the server node cookie). πͺπ
ngl bestie, quick recap of the whole page:app_nodefinds the node running an app (and fails your test case if nobody is),callactually waits for an answer and hands you{badrpc, Reason}if it goes sideways, andcastjust yeets it and returnsokwith zero waiting. theCookievariants set the client node cookie for the operation so it matches the server node cookie. that's the tea β
made with love by Ericsson AB π β this is common_test version 1.24.0.1, and the page itself is ct_rpc(3erl). slay, go write some tests, mwah πβ¨
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms