提交 aebbd4bb 编写于 作者: J Jeremy Kemper

No need to defensively work jobs in another thread

上级 96e713b0
......@@ -110,7 +110,7 @@ def shutdown
end
def drain
Thread.new { run(@queue.pop) until @queue.empty? }.join
run(@queue.pop) until @queue.empty?
end
def consume
......
......@@ -97,6 +97,6 @@ def test_drain
assert @queue.empty?
assert job.ran?, "The job runs synchronously when the queue is drained"
assert_not_equal job.thread_id, Thread.current.object_id
assert_equal job.thread_id, Thread.current.object_id
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册