aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/support/integration/adapters/que.rb
blob: f15c9af9108b5bf1a3b06c0d27d21f0c405459af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module QueJobsManager
  def clear_jobs
    Que.clear!
  end

  def start_workers
    @thread = Thread.new do
      loop do
        Que::Job.work("active_jobs_default")
        sleep 0.5
      end
    end
  end

  def stop_workers
    @thread.kill
  end
end