Project

General

Profile

« Previous | Next » 

Revision 7466fc08

Added by Marc Dequènes over 13 years ago

  • ID 7466fc083799a22deae3d56779823c810028f280

[evol] server API tree reworked using a DSL (reply handling rework is WIP)

View differences:

bin/test_client
toto = true
task "compare stuff" do
ask "MapMaker", :ver1, "/api_version"
ask "Librarian", :ver2, "/api_version"
ask "MapMaker", :info1, "/_cyborg_"
ask "Librarian", :info2, "/_cyborg_"
ask "MapMaker", :zones, "/DNS/Zones"
on_error do
puts "PLOUF"
......
puts "OK"
pp errors
pp results
puts "Tadam: " + (results[:ver1] == results[:ver2] ? "same" : "different")
puts "Tadam: " + (results[:info1][:api_version] == results[:info2][:api_version] ? "same" : "different")
meet "waiter", :zzz
STDOUT.flush
on_success do
puts "OK compare stuff"
end
end
on_error do
stop_bot :at_once
end
end
task "waiter" do
meet "compare stuff", :zzz
on_success do
puts "OK waiter"
#stop_bot :at_once
stop_bot :when_finished
end
end
# conversation_with "MapMaker" do
# on_error do
# puts "Halalalala !"
# end
# thread "super taiste" do
# call :ver, "/api_version"
# call :zones, "/DNS/Zones" if toto
# on_error do
# puts "Sniff !"
# pp reply
# end
# on_success do
# puts "Yahou !"
# pp reply
# call :gogogo, "/DNS"
# on_error do
# pp "Plouf"
# pp reply
# end
# on_success do
# pp "Hop!"
# pp reply
# send_notification 'meetpoint', { :topic => "MYNOTIF", :msg => "plop" }
# end
# end
# end
# #stop_bot :at_once
# stop_bot :when_finished
# end
# conversation_with "Librarian" do
# thread "taistouille" do
# call :sdf, "/Gruik"
# on_success do
# puts "Librarian GoGoGo!"
# pp reply
# wait_notification 'meetpoint', { :topic => "MYNOTIF" }
# on_success do
# puts "NOTIF!"
# pp reply
# end
# end
# end
# end
end
end
end

Also available in: Unified diff