Some people, when confronted with a problem, think “I know, I’ll use multithreading”. Nothhw tpe yawrve o oblems.

Don’t use threads, use processes. This is the toolkit for interprocess communication that makes it real simple. A good place to start is the documentation for the Cod module.

SYNOPSIS

# Cod's basic elements are channels, unidirectional communication links. 
pipe = Cod.pipe

# You can use those either directly: 
pipe.put :some_ruby_object        # Process A
pipe.get # => :some_ruby_object   # Process B

# Or use them as bricks for more: 
service = beanstalk.service
client  = beanstalk.client(pipe)

service.one { |msg| :response }               # Process A
client.call :ruby_object    # => :response    # Process B

STATUS

Complete rewrite of the code: Did away with some of the complexities that stemmed from early design work. The functionality that is there is much like that we had before, but some things have been designed more logically.

At version 0.4.0

© 2011 Kaspar Schiess

1

twitter.com/rogerbraun/status/160813717502705664