Project

General

Profile

« Previous | Next » 

Revision 4d9f2962

Added by Marc Dequènes almost 14 years ago

  • ID 4d9f2962db882142ce63530d9b8844890bb557be

[evol] Task-based client DSL §4 (many fixes, helper, bot stop condition, more logging)

View differences:

bin/test_client
$: << File.join(File.dirname(__FILE__), "..", "lib")
require 'cyborghood/cyborg'
require 'cyborghood/cyborg/dsl'
module CyborgHood
......
# to test the closure through the inner instance_eval calls
toto = true
# task "compare stuff" do
c = 0
task "compare stuff" do
# ask :MapMaker, :ver1, "/api_version"
# ask :Librarian, :ver2, "/api_version"
# on_error do
# puts "PLOUF"
# pp reply
# end
# on_success do
# puts "OK"
# pp reply
wait_notification :thread, {:topic => "HELOz"}, 5 do |subtask, msg|
puts "POUET NOTIF"
subtask.finish
end
send_notification :thread, {:topic => "HELO"}
wait_timer 2, true do |subtask|
c += 1
puts "TIMER !!!"
STDOUT.flush
subtask.finish if c == 10
end
on_error do
puts "PLOUF"
pp errors
pp results
end
on_success do
puts "OK"
pp errors
pp results
# puts "Tadam: " + (ver1 == ver2 ? "same" : "different")
# end
# end
end
end
conversation_with "MapMaker" do
on_error do

Also available in: Unified diff