Josh
Josh

Reputation: 11070

Is communication between two ruby processes possible/easy?

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.

Upvotes: 4

Views: 4312

Answers (2)

mpd
mpd

Reputation: 2229

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.

Upvotes: 4

tinifni
tinifni

Reputation: 2392

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

Upvotes: 0

Related Questions