Is communication between two ruby processes possib

2019-03-21 19:18发布

If I have a ruby script Daemon that, as it's name implies, runs as a daemon, monitoring parts of the system and able to perform commands which require authentication, for example changing permissions, is there an easy way to have a second ruby script, say client, communicate to that script and send it commands / ask for information? I'm looking for a built in ruby way of doing this, I'd prefer to avoid building my own server protocol here.

2条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-03-21 19:35

Ruby provides many mechanisms for this including your standards such as: sockets, pipes, shared memory. But ruby also has a higher level library specifically for IPC which you can checkout Here, Drb. I haven't had a chance to play around with it too much but it looks really cool.

查看更多
你好瞎i
3楼-- · 2019-03-21 19:53

You may want to look into http://rubyeventmachine.com/

查看更多
登录 后发表回答