[erlang-questions] how to dynamically create function to run in a different node

Ulf Wiger ulf@REDACTED
Thu Jan 1 22:15:15 CET 2015


> On 31 Dec 2014, at 18:49, Dror Mein <drormein@REDACTED> wrote:
> 
> Thank you!
> 
> so parse_transform is responsible of returning {M,F,A} where A is something I don't yet understand :).
> is there a way to turn {M,F,A} to fun?

Well, if you want to dispatch it to another node, using a (compiled) fun is problematic. This is the main reason why I used {erl_eval, exprs, [Exprs, Bindings]}.


> Is there a simpler way to create a fun that can be run on a different node?

A fun can be run on a different node if the module it was compiled in has a compatible version (it doesn’t have to be the exact same version).

BR,
Ulf W

Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.
http://feuerlabs.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150101/69308b00/attachment.htm>


More information about the erlang-questions mailing list