I found that interrupting a reactor doesn't work if a subtask is waiting for a queue.
require 'async'
require 'async/queue'
reactor = Async::Reactor.new
queue = Async::Queue.new
puts 'a'
reactor.run do |task|
task.async do
queue.dequeue
end
reactor.interrupt
end
puts 'b'
reactor.run do
reactor.interrupt
puts 'c'
end
puts 'd' # this is never reached
The first interrupt works, but the second somehow doesn't.
I found that interrupting a reactor doesn't work if a subtask is waiting for a queue.
The first interrupt works, but the second somehow doesn't.
On MacOS.