Class: Shoryuken::Client
- Inherits:
-
Object
- Object
- Shoryuken::Client
- Defined in:
- lib/shoryuken/client.rb
Overview
Client class for interacting with SQS queues. Provides a simple interface for accessing and managing queue instances.
Constant Summary collapse
- @@queues =
Returns cached queue instances by name.
{}
Class Method Summary collapse
-
.queues(name) ⇒ Shoryuken::Queue
Returns a Queue instance for the given queue name.
-
.sqs ⇒ Aws::SQS::Client
Returns the current SQS client.
-
.sqs=(sqs) ⇒ Aws::SQS::Client
Sets a new SQS client and clears the queue cache.
Class Method Details
.queues(name) ⇒ Shoryuken::Queue
Returns a Queue instance for the given queue name
15 16 17 |
# File 'lib/shoryuken/client.rb', line 15 def queues(name) @@queues[name.to_s] ||= Shoryuken::Queue.new(sqs, name) end |
.sqs ⇒ Aws::SQS::Client
Returns the current SQS client
22 23 24 |
# File 'lib/shoryuken/client.rb', line 22 def sqs Shoryuken.sqs_client end |
.sqs=(sqs) ⇒ Aws::SQS::Client
Sets a new SQS client and clears the queue cache
30 31 32 33 34 35 36 |
# File 'lib/shoryuken/client.rb', line 30 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 |