GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Rails::Queueing::TestQueue is working as a LIFO while it should be a FIFO (as we expect the first queued job to be run first).
fixes run order in Rails::Queueing::TestQueue
clean up empty lines
irb(main):001:0> require 'thread'
irb(main):002:0> q = Queue.new
=> #<Queue:0x007fa193062b38 @que=, @waiting=, @mutex=#<Mutex:0x007fa193062ac0>>
irb(main):003:0> q.push "first"
irb(main):004:0> q.push "second"
irb(main):005:0> q.push "third"
Please keep the pop method as pop. Thanks!
Yes, Queue is working as a FIFO, and that's perfect. But shouldn't TestQueue behave the same way? Currently calling Queue#drain goes pop-ing out the latest jobs from the @contents array.
@tenderlove he's talking about the test queue which is an array.
Doh! You're totally right. I completely read the diff wrong. :'(
Merge pull request #6020 from 7even/test_queue_order
Rails::Queueing::TestQueue run order