aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/support/integration/jobs_manager.rb
blob: 4775f52b2f6e613a7e409c5bbd41e00b6a53b0fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

class JobsManager
  @@managers = {}
  attr :adapter_name

  def self.current_manager
    @@managers[ENV["AJ_ADAPTER"]] ||= new(ENV["AJ_ADAPTER"])
  end

  def initialize(adapter_name)
    @adapter_name = adapter_name
    require_relative "adapters/#{adapter_name}"
    extend "#{adapter_name.camelize}JobsManager".constantize
  end

  def setup
    ActiveJob::Base.queue_adapter = nil
  end

  def clear_jobs
  end

  def start_workers
  end

  def stop_workers
  end
end