0
调用周期性定时器,当块内发生错误时,更改此周期性定时器延迟。我可以使用定期计时器还是最好的方法是add_timer?EventMachine更改块内周期性定时器的延迟
嗨,我想这样做:
EventMachine.run
EventMachine.add_periodic_timer 1
//read from a input
//if error set timer to 20s
//if ok set timer to 1s
end
end
如何? 感谢
是的,我已经找到了一些分钟前! http://eventmachine.rubyforge.org/EventMachine/PeriodicTimer.html#interval-instance_method谢谢! – andrea