Class: Consumer::Actor
- Inherits:
-
Object
- Object
- Consumer::Actor
- Includes:
- Actor, Dependency, Initializer, Log::Dependency
- Defined in:
- lib/consumer/actor.rb
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#prefetch_queue ⇒ Object
13 14 15 |
# File 'lib/consumer/actor.rb', line 13 def prefetch_queue @prefetch_queue ||= [] end |
Class Method Details
.build(consumer, subscription) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/consumer/actor.rb', line 17 def self.build(consumer, subscription) subscription_address = subscription.address delay_threshold = subscription.batch_size instance = new(subscription_address, delay_threshold) instance.consumer = consumer instance.configure instance end |
Instance Method Details
#request_batch ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/consumer/actor.rb', line 74 def request_batch logger.trace(tag: :actor) { "Requesting batch (Prefetch Queue Depth: #{prefetch_queue.size}, Delay Threshold: #{delay_threshold})" } get_batch = Subscription::GetBatch.new(address) send.(get_batch, subscription_address) logger.debug(tag: :actor) { "Sent batch request (Prefetch Queue Depth: #{prefetch_queue.size}, Delay Threshold: #{delay_threshold})" } nil end |