Class: Hushed::Queue
- Inherits:
-
Object
- Object
- Hushed::Queue
- Defined in:
- lib/hushed/queue.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #approximate_pending_messages ⇒ Object
-
#initialize(client) ⇒ Queue
constructor
A new instance of Queue.
- #receive ⇒ Object
- #send(message) ⇒ Object
Constructor Details
#initialize(client) ⇒ Queue
Returns a new instance of Queue.
4 5 6 |
# File 'lib/hushed/queue.rb', line 4 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/hushed/queue.rb', line 3 def client @client end |
Instance Method Details
#approximate_pending_messages ⇒ Object
23 24 25 |
# File 'lib/hushed/queue.rb', line 23 def client.from_quiet_queue. end |
#receive ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/hushed/queue.rb', line 13 def receive queue = client.from_quiet_queue = nil queue. do |msg| = Message.new(xml: msg.body) . = msg end || Message.new end |
#send(message) ⇒ Object
8 9 10 11 |
# File 'lib/hushed/queue.rb', line 8 def send() queue = client.to_quiet_queue queue.(.to_xml) end |