Class: Alephant::Publisher::SQSHelper::Queue
- Inherits:
-
Object
- Object
- Alephant::Publisher::SQSHelper::Queue
- Includes:
- Logger
- Defined in:
- lib/alephant/publisher/sqs_helper/queue.rb
Constant Summary collapse
- WAIT_TIME =
5
- VISABILITY_TIMEOUT =
300
Instance Attribute Summary collapse
-
#archiver ⇒ Object
readonly
Returns the value of attribute archiver.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
-
#wait_time ⇒ Object
readonly
Returns the value of attribute wait_time.
Instance Method Summary collapse
-
#initialize(queue, archiver = nil, timeout = VISABILITY_TIMEOUT, wait_time = WAIT_TIME) ⇒ Queue
constructor
A new instance of Queue.
- #message ⇒ Object
Constructor Details
#initialize(queue, archiver = nil, timeout = VISABILITY_TIMEOUT, wait_time = WAIT_TIME) ⇒ Queue
Returns a new instance of Queue.
15 16 17 18 19 20 21 22 |
# File 'lib/alephant/publisher/sqs_helper/queue.rb', line 15 def initialize(queue, archiver = nil, timeout = VISABILITY_TIMEOUT, wait_time = WAIT_TIME) @queue = queue @archiver = archiver @timeout = timeout @wait_time = wait_time logger.debug("Queue#initialize: reading from #{queue.url}") end |
Instance Attribute Details
#archiver ⇒ Object (readonly)
Returns the value of attribute archiver.
13 14 15 |
# File 'lib/alephant/publisher/sqs_helper/queue.rb', line 13 def archiver @archiver end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
13 14 15 |
# File 'lib/alephant/publisher/sqs_helper/queue.rb', line 13 def queue @queue end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
13 14 15 |
# File 'lib/alephant/publisher/sqs_helper/queue.rb', line 13 def timeout @timeout end |
#wait_time ⇒ Object (readonly)
Returns the value of attribute wait_time.
13 14 15 |
# File 'lib/alephant/publisher/sqs_helper/queue.rb', line 13 def wait_time @wait_time end |
Instance Method Details
#message ⇒ Object
24 25 26 |
# File 'lib/alephant/publisher/sqs_helper/queue.rb', line 24 def receive.tap { |m| process(m) unless m.nil? } end |