瘦服务器基于 EventMachine,因此我无法从 EM.synchrony 块中阻止它。但在这种情况下,输出是:2, 1 但不是 1,2。我该如何解决?
EM.synchrony do
update_ads ads_hash, invalid_ads, ip, params, user_agent, request
EM::Synchrony::FiberIterator.new([1,2,3]).each do |i|
# some http requests
end
puts "1"
# EventMachine.stop
end
puts "2"
感谢提前!