Module: ActiveJob::QueueAdapters::SolidQueueExt::Workers

Included in:
ActiveJob::QueueAdapters::SolidQueueExt
Defined in:
lib/active_job/queue_adapters/solid_queue_ext/workers.rb

Instance Method Summary collapse

Instance Method Details

#count_workers(workers_relation) ⇒ Object



12
13
14
# File 'lib/active_job/queue_adapters/solid_queue_ext/workers.rb', line 12

def count_workers(workers_relation)
  solid_queue_processes_from_workers_relation(workers_relation).count
end

#exposes_workers?Boolean

Returns:

  • (Boolean)


2
3
4
# File 'lib/active_job/queue_adapters/solid_queue_ext/workers.rb', line 2

def exposes_workers?
  true
end

#fetch_workers(workers_relation) ⇒ Object



6
7
8
9
10
# File 'lib/active_job/queue_adapters/solid_queue_ext/workers.rb', line 6

def fetch_workers(workers_relation)
  solid_queue_processes_from_workers_relation(workers_relation).collect do |process|
    worker_from_solid_queue_process(process)
  end
end

#find_worker(worker_id) ⇒ Object



16
17
18
19
20
# File 'lib/active_job/queue_adapters/solid_queue_ext/workers.rb', line 16

def find_worker(worker_id)
  if process = SolidQueue::Process.find_by(id: worker_id)
    worker_attributes_from_solid_queue_process(process)
  end
end