Class: RailsConsolePro::Services::QueueInsightFetcher::Adapters::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_console_pro/services/queue_insight_fetcher.rb

Direct Known Subclasses

Generic, Sidekiq, SolidQueue

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(queue_adapter) ⇒ Base

Returns a new instance of Base.



79
80
81
# File 'lib/rails_console_pro/services/queue_insight_fetcher.rb', line 79

def initialize(queue_adapter)
  @queue_adapter = queue_adapter
end

Instance Attribute Details

#queue_adapterObject (readonly)

Returns the value of attribute queue_adapter.



77
78
79
# File 'lib/rails_console_pro/services/queue_insight_fetcher.rb', line 77

def queue_adapter
  @queue_adapter
end

Instance Method Details

#fetch(limit:, queue:) ⇒ Object



83
84
85
86
# File 'lib/rails_console_pro/services/queue_insight_fetcher.rb', line 83

def fetch(limit:, queue:)
  payload = gather(limit: limit, queue: queue)
  build_result(**payload.merge(limit: limit))
end