Class: Shoryuken::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/shoryuken/client.rb

Constant Summary collapse

@@queues =
{}

Class Method Summary collapse

Class Method Details

.queues(name) ⇒ Object


6
7
8
# File 'lib/shoryuken/client.rb', line 6

def queues(name)
  @@queues[name.to_s] ||= Shoryuken::Queue.new(sqs, name)
end

.sqsObject


10
11
12
# File 'lib/shoryuken/client.rb', line 10

def sqs
  Shoryuken.sqs_client
end

.sqs=(sqs) ⇒ Object


14
15
16
17
18
19
20
# File 'lib/shoryuken/client.rb', line 14

def sqs=(sqs)
  # Since the @@queues values (Shoryuken::Queue objects) are built referencing @@sqs, if it changes, we need to
  #   re-build them on subsequent calls to `.queues(name)`.
  @@queues = {}

  Shoryuken.sqs_client = sqs
end