[erlang-questions] calling Erlang functions from linked-in driver

Michael Truog <>
Wed Aug 22 09:17:38 CEST 2012


You could use
http://www.erlang.org/doc/man/erl_driver.html#driver_send_term
or
http://www.erlang.org/doc/man/erl_nif.html#enif_send
to call Erlang code by sending an Erlang process a message (which is then handled so that it calls the Erlang code you want to call).

On 08/21/2012 11:48 PM, Motiejus Jakštys wrote:
> Hi,
>
> We are looking for a way to call Erlang functions from linked-in port
> driver (or NIF). From documentation I cannot see any way to do it. We
> want to call some Erlang functions from Lua code[1], which is executed
> in linked-in driver (can be re-implemented in NIF).
>
> In C node case this would be simple. However, for this C node is a bit
> overkill (we want erlualib side effects to be as small as possible).
> Linked-in drivers and NIFs are conceptually perfect for it.
>
> Is there a way to call Erlang function from linked-in driver or NIF
> *before* returning the result to emulator?
>
> Thanks,
> Motiejus Jakštys
>
> [1]: https://github.com/Motiejus/erlualib
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list