Packages

This is a GenServer-ish implementation of an apply function, which allows you to invoke function call on a different node.

Current section

Files

Jump to
function_invoker lib function_invoker.ex
Raw

lib/function_invoker.ex

defmodule FunctionInvoker do
def invoke(server, module, function, args) do
server |> GenServer.call({:call, module, function, args})
end
def init([]) do
{:ok, []}
end
def handle_call({:call, module, function, args}, _from, state) do
{:reply, apply(module, function, args), state}
end
end