fun zeromq example that simulates life at the office
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
README.markdown
boss_process
hr_process
models.rb
worker_process

README.markdown

Life at the office

What

This is a fun little ZeroMQ example that simulates life at the office.

First, open up some terminals and fire up the boss and hr processes with

./boss_process
./hr_process

Next, fire up a worker process:

./worker_process

Now you can start bossing that worker around. In the boss's terminal, try typing

somebody jump

Notice that the worker happily obliges and the hr person happily logs what happened.

Next, have the boss request something complicated, and watch the worker struggle valiantly.

somebody do_something_complicated

Notice that the boss asked for somebody to do something complicated; there's only one worker, so that's the only worker who does something complicated. Now try firing up a few more worker processes in different terminals, and do some more bossing. Notice that somebody requests are equitably distributed amongst the workers, while everybody requests make it to every worker, no matter how many there are and no matter when they started working!

Prerequisites

brew install zeromq
gem install zmq