Class: Ungulate::SqsMessageQueue
- Inherits:
-
Object
- Object
- Ungulate::SqsMessageQueue
- Defined in:
- lib/ungulate/sqs_message_queue.rb
Instance Method Summary collapse
- #clear ⇒ Object
-
#initialize(name, options) ⇒ SqsMessageQueue
constructor
A new instance of SqsMessageQueue.
- #name ⇒ Object
- #push(message) ⇒ Object
- #receive ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(name, options) ⇒ SqsMessageQueue
Returns a new instance of SqsMessageQueue.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ungulate/sqs_message_queue.rb', line 5 def initialize(name, ) if name.blank? raise Ungulate::MissingConfiguration, "queue_name must be set in config" end sqs = RightAws::SqsGen2.new( [:access_key_id], [:secret_access_key], :server => [:server] ) @queue = sqs.queue name end |
Instance Method Details
#clear ⇒ Object
22 23 24 |
# File 'lib/ungulate/sqs_message_queue.rb', line 22 def clear @queue.clear end |
#name ⇒ Object
18 19 20 |
# File 'lib/ungulate/sqs_message_queue.rb', line 18 def name @queue.name end |
#push(message) ⇒ Object
26 27 28 |
# File 'lib/ungulate/sqs_message_queue.rb', line 26 def push() @queue.push() end |
#receive ⇒ Object
30 31 32 |
# File 'lib/ungulate/sqs_message_queue.rb', line 30 def receive @queue.receive end |
#size ⇒ Object
34 35 36 |
# File 'lib/ungulate/sqs_message_queue.rb', line 34 def size @queue.size end |