Class: Poseidon::ConsumerGroup::Consumer Private

Inherits:
PartitionConsumer
  • Object
show all
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

Instance Method Summary collapse

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
# File 'lib/poseidon/consumer_group.rb', line 37

def initialize(group, partition, options = {})
  broker = group.leader(partition)
  offset = group.offset(partition)
  offset = (options[:trail] ? :latest_offset : :earliest_offset) if offset == 0
  options.delete(:trail)
  super group.id, broker.host, broker.port, group.topic, partition, offset, options
end

Instance Attribute Details

#partitionObject (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