Class: Eventboss::Fetcher
- Inherits:
-
Object
- Object
- Eventboss::Fetcher
- Defined in:
- lib/eventboss/fetcher.rb
Constant Summary collapse
- FETCH_LIMIT =
maximum possible for SQS
10
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #delete(queue, message) ⇒ Object
- #fetch(queue, limit) ⇒ Object
-
#initialize(configuration) ⇒ Fetcher
constructor
A new instance of Fetcher.
Constructor Details
#initialize(configuration) ⇒ Fetcher
Returns a new instance of Fetcher.
7 8 9 |
# File 'lib/eventboss/fetcher.rb', line 7 def initialize(configuration) @client = configuration.sqs_client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/eventboss/fetcher.rb', line 5 def client @client end |
Instance Method Details
#delete(queue, message) ⇒ Object
15 16 17 |
# File 'lib/eventboss/fetcher.rb', line 15 def delete(queue, ) @client.(queue_url: queue.url, receipt_handle: .receipt_handle) end |
#fetch(queue, limit) ⇒ Object
11 12 13 |
# File 'lib/eventboss/fetcher.rb', line 11 def fetch(queue, limit) @client.(queue_url: queue.url, max_number_of_messages: (limit)). end |