EM.stop waiting for a Timer #426

Closed
tbuehlmann opened this Issue Mar 22, 2013 · 2 comments

Comments

Projects
None yet
2 participants

Stumbled over this behaviour:

require 'eventmachine'

time = Time.now

EM.run do
  EM::Timer.new(2) { }
  EM::Timer.new(3) { }
  EM.stop
end

p Time.now - time # => 2.002319139
require 'eventmachine'

time = Time.now

EM.run do
  EM::Timer.new(3) { }
  EM::Timer.new(2) { }
  EM.stop
end

p Time.now - time # => 2.002313275

Using eventmachine 1.0.3 on ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux].

Contributor

ibc commented Mar 22, 2013

It seems a degisn issue. It seems that, onde there is an event loaded into the reactor (the timer which fires before, so the 2 seconds timer) EM.stop does not do its job until such an event is fired.

@tmm1 tmm1 closed this in 8b613d0 Apr 2, 2013

Perfect, works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment