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
44
45
46
47
48
49
# File 'lib/poseidon/consumer_group.rb', line 37

def initialize(group, partition, options = {})
  opts   = options.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

#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