Skip to content

Instantly share code, notes, and snippets.

@chrisconley
Created January 12, 2012 03:22
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 chrisconley/1598359 to your computer and use it in GitHub Desktop.
Save chrisconley/1598359 to your computer and use it in GitHub Desktop.
config.after_initialize do
::RuoteEngine = Ruote::Engine.new(
Ruote::Worker.new(
Ruote::Redis::RedisStorage.new(::REDIS)))
RuoteEngine.register_participant :turk_unit, TurkUnitParticipant
RuoteEngine.register_participant :weighted_consensus, WeightedConsensusParticipant
RuoteEngine.register_participant :printer do |workitem|
puts workitem.fields['decisions']['default']['output'].inspect
end
end
Ruote.process_definition :name => 'DefaultWorkflow' do
cursor do
participant :unit, "step_name" => "default", "input" => "${f:task.input}"
participant :weighted_consensus, "step_name" => "default"
rewind :unless => '${f:decisions.default.ok}'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment