Build Status Code Climate

zchannel.rb

zchannel is a library that can be used for sending and receiving objects between Ruby processes who share a parent-child relationship. The interface is simple and easy to use.

Examples

1.

Marshal is the module we'll use for serialization.

ch = ZChannel.unix Marshal
Process.wait fork { ch.send "Hello, world!" }
ch.recv # => "Hello, world!"

2.

In the 2nd example we choose JSON for serialization. Any serializer that implements the dump and load methods will do.

ch = ZChannel.unix JSON
Process.wait fork { ch.send [1,2,3] }
ch.recv # => [1,2,3]

Install

Using Bundler

  gem "zchannel", github: "r-obert/zchannel.rb", tag: "v0.4.0"

Using Git & Rubygems

git clone https://github.com/r-obert/zchannel.rb.git
cd zchannel.rb
gem build zchannel.gemspec
gem install zchannel*.gem

Useful Links