我使用Ruby curb一次調用多個url,如何在使用ruby/curb進行url超時時退出異步調用
require 'rubygems'
require 'curb'
easy_options = {:follow_location => true}
multi_options = {:pipeline => true}
Curl::Multi.get(['http://www.example.com','http://www.trello.com','http://www.facebook.com','http://www.yahoo.com','http://www.msn.com'], easy_options, multi_options) do|easy|
# do something interesting with the easy response
puts easy.last_effective_url
end
這個問題我已經是我想要的任何URL超時發生時打破後續異步調用,這可能嗎?