aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/support/integration/adapters/queue_classic.rb
blob: 3b24eca5b961c4866264939670f572cd5aa66f82 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module QC; WAIT_TIME = 0.5; end

module QueueClassicJobsManager
  def clear_jobs
    # disabling this as it locks
    # QC::Queue.new("active_jobs_default").delete_all
  end

  def start_workers
    @pid = fork do
      QC::Conn.connection = QC::Conn.connect
      worker = QC::Worker.new(q_name: 'active_jobs_default')
      worker.start
    end
  end

  def stop_workers
    Process.kill 'HUP', @pid
  end
end