Class: Poseidon::ConsumerGroup::Consumer Private
- Inherits:
-
PartitionConsumer
- Object
- PartitionConsumer
- Poseidon::ConsumerGroup::Consumer
- Defined in:
- lib/poseidon/consumer_group.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Poseidon::ConsumerGroup::Consumer is internally used by Poseidon::ConsumerGroup. Don’t invoke it directly.
Instance Attribute Summary collapse
- #partition ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(group, partition, options = {}) ⇒ Consumer
constructor
private
A new instance of Consumer.
Constructor Details
#initialize(group, partition, options = {}) ⇒ Consumer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Consumer.
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/poseidon/consumer_group.rb', line 37 def initialize(group, partition, = {}) opts = .dup broker = group.leader(partition) offset = group.offset(partition) offset = (opts[:trail] ? :latest_offset : :earliest_offset) if offset == 0 # Remove unsupported options for Poseidon::PartitionConsumer opts.delete(:claim_timeout) opts.delete(:register) opts.delete(:trail) super(group.id, broker.host, broker.port, group.topic, partition, offset, opts) end |
Instance Attribute Details
#partition ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
34 35 36 |
# File 'lib/poseidon/consumer_group.rb', line 34 def partition @partition end |