Class: Sqewer::Connection::MessageBuffer
- Inherits:
-
Struct
- Object
- Struct
- Sqewer::Connection::MessageBuffer
- Defined in:
- lib/sqewer/connection.rb
Overview
Stores the messages for the SQS queue (both deletes and sends), and yields them in allowed batch sizes
Direct Known Subclasses
Constant Summary collapse
- MAX_RECORDS =
10
Instance Attribute Summary collapse
-
#messages ⇒ Object
Returns the value of attribute messages.
Instance Method Summary collapse
- #each_batch ⇒ Object
-
#initialize ⇒ MessageBuffer
constructor
A new instance of MessageBuffer.
Constructor Details
#initialize ⇒ MessageBuffer
Returns a new instance of MessageBuffer.
102 103 104 |
# File 'lib/sqewer/connection.rb', line 102 def initialize super([]) end |
Instance Attribute Details
#messages ⇒ Object
Returns the value of attribute messages
100 101 102 |
# File 'lib/sqewer/connection.rb', line 100 def @messages end |
Instance Method Details
#each_batch ⇒ Object
105 106 107 |
# File 'lib/sqewer/connection.rb', line 105 def each_batch .each_slice(MAX_RECORDS){|batch| yield(batch)} end |