Skip to content

Instantly share code, notes, and snippets.

/t.rb

Created September 16, 2011 08:33
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/1221565 to your computer and use it in GitHub Desktop.
Save anonymous/1221565 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'rufus-json/automatic'
require 'ruote'
engine = Ruote::Dashboard.new(
Ruote::Worker.new(
Ruote::HashStorage.new()))
engine.register 'computer' do |workitem|
workitem.fields['hello'] = 'world'
end
engine.register 'human', Ruote::StorageParticipant
engine.noisy = true
pdef = Ruote.define do
computer
human
end
initial_workitem_fields = { 'a' => 'b' }
engine.launch(pdef, initial_workitem_fields)
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