Class: Alephant::Publisher::Queue::SQSHelper::Queue
- Inherits:
-
Object
- Object
- Alephant::Publisher::Queue::SQSHelper::Queue
- Includes:
- Logger
- Defined in:
- lib/alephant/publisher/queue/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.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/alephant/publisher/queue/sqs_helper/queue.rb', line 16 def initialize( queue, archiver = nil, timeout = VISABILITY_TIMEOUT, wait_time = WAIT_TIME ) @queue = queue @archiver = archiver @timeout = timeout @wait_time = wait_time log_queue_creation queue.url, archiver, timeout end |
Instance Attribute Details
#archiver ⇒ Object (readonly)
Returns the value of attribute archiver.
14 15 16 |
# File 'lib/alephant/publisher/queue/sqs_helper/queue.rb', line 14 def archiver @archiver end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
14 15 16 |
# File 'lib/alephant/publisher/queue/sqs_helper/queue.rb', line 14 def queue @queue end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
14 15 16 |
# File 'lib/alephant/publisher/queue/sqs_helper/queue.rb', line 14 def timeout @timeout end |
#wait_time ⇒ Object (readonly)
Returns the value of attribute wait_time.
14 15 16 |
# File 'lib/alephant/publisher/queue/sqs_helper/queue.rb', line 14 def wait_time @wait_time end |
Instance Method Details
#message ⇒ Object
29 30 31 |
# File 'lib/alephant/publisher/queue/sqs_helper/queue.rb', line 29 def receive.tap { |m| process(m) unless m.nil? } end |