Packages

Call Erlang/Elixir functions from NIF and use the returned value in NIF.

Current section

Files

Jump to
nif_call lib nif_call.ex
Raw

lib/nif_call.ex

defmodule NifCall do
def run(name, to_be_called, fun) do
tag = NifCall.Runner.register(name, to_be_called)
try do
fun.(tag)
after
NifCall.Runner.unregister(name, tag)
end
end
end