Class: Fairway::Sidekiq::Fetch::Fetches

Inherits:
Object
  • Object
show all
Defined in:
lib/fairway/sidekiq/fetch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#listObject (readonly)

Returns the value of attribute list.



5
6
7
# File 'lib/fairway/sidekiq/fetch.rb', line 5

def list
  @list
end

Instance Method Details

#from(queue, weight = 1, &block) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/fairway/sidekiq/fetch.rb', line 7

def from(queue, weight = 1, &block)
  if queue == :sidekiq
    queue = BasicFetch.new(::Sidekiq.options)
  else
    queue = FairwayFetch.new(queue, &block)
  end

  weight.times do
    list << queue
  end
end