Skip to content

Instantly share code, notes, and snippets.

/t.rb

Created September 16, 2011 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1221507 to your computer and use it in GitHub Desktop.
Save anonymous/1221507 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'rufus-json/automatic'
require 'ruote'
engine = Ruote::Engine.new(
Ruote::Worker.new(
Ruote::HashStorage.new()))
engine.register 'computer' do |workitem|
workitem.fields['hello'] = 'world'
end
engine.register 'human', Ruote::StorageParticipant
pdef = Ruote.define do
computer
human
end
2.times { engine.launch(pdef) }
sleep 5
puts "human: there are #{engine.storage_participant.size} workitems waiting for me"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment