lib/async/scheduler.rb in async-2.18.0 vs lib/async/scheduler.rb in async-2.19.0

- old
+ new

@@ -386,17 +386,24 @@ break unless yield end end rescue Interrupt => interrupt Thread.handle_interrupt(::SignalException => :never) do + Console.debug(self) do |buffer| + buffer.puts "Scheduler interrupted: #{interrupt.inspect}" + self.print_hierarchy(buffer) + end + self.stop end retry end # If the event loop was interrupted, and we finished exiting normally (due to the interrupt), we need to re-raise the interrupt so that the caller can handle it too. - Kernel.raise(interrupt) if interrupt + if interrupt + Kernel.raise(interrupt) + end end # Run the reactor until all tasks are finished. Proxies arguments to {#async} immediately before entering the loop, if a block is provided. def run(...) Kernel.raise ClosedError if @selector.nil?