Call Erlang from Ruby

南笙酒味 提交于 2019-12-07 11:25:44

问题


What is the most awesome gem I should use to call Erlang functions from Ruby app? I wish to use rspec for testing some gen_server stuff.

Erlectricity looking solid, but there is no something like Node#rpc, just message passing. Any ideas?


回答1:


Well. I am using BERT-RPC and happy with it.

http://github.com/mojombo/bertrpc




回答2:


For rpc calls, rinterface might be the right option. From the README:

r = Erlang::Node.rpc("math","math_server","add",[10,20])
if r[0] == :badrpc
   puts "Got and Error. Reason #{r[1]}"
else
   puts "Success: #{r[1]}"
end



回答3:


I think (someone prove me wrong) that you shouldn't use rspec for a gen_server at all. Instead you could, depening on what your gen_server actually does, use eunit. http://salientblue.com/codenotes/?name=erl_start and no, its a long way from rspec.



来源:https://stackoverflow.com/questions/2028172/call-erlang-from-ruby

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!