Ruby 和 Erlang 正在交谈
我想让 Ruby 应用程序生成一个 Erlang 进程并让它向 Ruby 报告。到目前为止,我研究了 Erlectricity,但无法找到一种方法来实现这一目标而不让 Erlang 生成 Ruby再次,我想这会有点混乱。
还有哪些其他方法呢? *MQ?插座?您认为什么最适合与单个 Erlang 进程对话的单个应用程序?它实际上还不需要扩展。
I want to let a Ruby app spawn an Erlang process and let it report back to Ruby. Until now I looked into Erlectricity, but couldn't figure out a way to achieve this without letting Erlang spawn Ruby again, which would be a bit messy I guess.
What other ways are there? *MQ? Sockets? What do you think fits best with a single app, talking to a single Erlang process? It really doesn't have to scale (yet).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我使用 Ruby
Open4.popen4
生成escript
进程,该进程从stdin
读取并通过简单的序列化写入stdout
(另一种选择是使用 escript params 将数据传递给 Erlang)。反过来,Escript 可以完全本地访问分布式 Erlang 节点。这不是一门复杂的技术,但它确实有效,而且比套接字更容易实现。I use Ruby
Open4.popen4
to spawnescript
process which reads fromstdin
and writes tostdout
with simple serialization (another option is to use escript params to pass data to Erlang). Escript in turn has full native access to distributed Erlang nodes. Not a rocket science, but it works and much easier to implement than sockets.您可以考虑使用 Ernie。它是一种 RPC 机制,使 Ruby 和 Erlang(以及其他语言,如果安装附加模块)之间的通信变得非常容易。
You could look into using Ernie. It's an RPC mechanism that makes it pretty easy to talk between Ruby and Erlang (and other languages if you install additional modules).
Thrift 同时支持 Erlang 和 Ruby:
另外,这个问题可能与这个和那个。
Thrift supports both Erlang and Ruby:
Also, this question might be a duplicate of this and that.