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.
77 78 79 |
# File 'lib/sqewer/connection.rb', line 77 def initialize super([]) end |
Instance Attribute Details
#messages ⇒ Object
Returns the value of attribute messages
75 76 77 |
# File 'lib/sqewer/connection.rb', line 75 def @messages end |
Instance Method Details
#each_batch ⇒ Object
80 81 82 |
# File 'lib/sqewer/connection.rb', line 80 def each_batch .each_slice(MAX_RECORDS){|batch| yield(batch)} end |