aboutsummaryrefslogblamecommitdiffstats
path: root/activejob/test/support/integration/adapters/sidekiq.rb
blob: d3b7d156144f238d1491e49228ae049351f59309 (plain) (tree)


















                                                                                                                                  
require 'sidekiq/launcher'
require 'sidekiq/api'

module SidekiqJobsManager
  def clear_jobs
    Sidekiq::Queue.new("active_jobs_default").clear
  end

  def start_workers
    options = {:queues=>["active_jobs_default"], :concurrency=>1, :environment=>"test", :timeout=>8, :daemon=>true, :strict=>true}
    @launcher = Sidekiq::Launcher.new(options)
    @launcher.run
  end

  def stop_workers
    @launcher.stop
  end
end