lib/karafka/pro/iterator.rb in karafka-2.2.14 vs lib/karafka/pro/iterator.rb in karafka-2.3.0.alpha1
- old
+ new
@@ -20,15 +20,10 @@
# the end. It also allows for signaling, when a given message should be last out of certain
# partition, but we still want to continue iterating in other messages.
#
# It does **not** create a consumer group and does not have any offset management.
class Iterator
- # Local partition reference for librdkafka
- Partition = Struct.new(:partition, :offset)
-
- private_constant :Partition
-
# A simple API allowing to iterate over topic/partition data, without having to subscribe
# and deal with rebalances. This API allows for multi-partition streaming and is optimized
# for data lookups. It allows for explicit stopping iteration over any partition during
# the iteration process, allowing for optimized lookups.
#
@@ -125,10 +120,10 @@
def stop_partition(name, partition)
@stopped_partitions += 1
@current_consumer.pause(
Rdkafka::Consumer::TopicPartitionList.new(
- name => [Partition.new(partition, 0)]
+ name => [Rdkafka::Consumer::Partition.new(partition, 0)]
)
)
end
private