Module: FlightControl::Server::Workers

Included in:
FlightControl::Server
Defined in:
lib/flight_control/server/workers.rb

Instance Method Summary collapse

Instance Method Details

#find_worker(worker_id) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/flight_control/server/workers.rb', line 6

def find_worker(worker_id)
  if (worker = queue_adapter.find_worker(worker_id))
    FlightControl::Worker.new(queue_adapter: queue_adapter, **worker)
  else
    raise FlightControl::Errors::ResourceNotFound, "Worker with id '#{worker_id}' not found"
  end
end

#workers_relationObject



2
3
4
# File 'lib/flight_control/server/workers.rb', line 2

def workers_relation
  FlightControl::WorkersRelation.new(queue_adapter: queue_adapter)
end