You can submit any valid Erlang term. Although you should be careful when sending pleasure. Any entertainment that references a function inside a module needs this module to exist on the target node to work:
( first@host )9> rpc:call( second@host , erlang, apply, [fun io:format/1, ["Hey!~n"]]). Hey! ok ( first@host )10> mymodule:func("Hey!~n"). 5 ( first@host )11> rpc:call( second@host , erlang, apply, [fun mymodule:func/1, ["Hey!~n"]]). {badrpc,{'EXIT',{undef,[{mymodule,func,["Hey!~n"]}, {rpc,'-handle_call_call/6-fun-0-',5}]}}}
In this example, io exists on both nodes, and it works to send functions from io as entertainment. However, mymodule exists only on the first node, and fun throws a undef exception when called on another node.
source share