Packages
function_invoker
0.1.0
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
Current section
Files
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