lib/em-synchrony.rb in em-synchrony-1.0.3 vs lib/em-synchrony.rb in em-synchrony-1.0.4

- old
+ new

@@ -133,7 +133,15 @@ # Routes to EM::Synchrony::Keyboard # def self.gets EventMachine::Synchrony::Keyboard.new.gets end + + # Interrupt current fiber to give chance to other fibers + # + def self.interrupt + fiber = Fiber.current + EM.next_tick { fiber.resume } + Fiber.yield + end end end