lib/racecar/consumer.rb in racecar-0.4.1 vs lib/racecar/consumer.rb in racecar-0.4.2
- old
+ new
@@ -11,13 +11,17 @@
@subscriptions ||= []
end
# Adds one or more topic subscriptions.
#
- # start_from_beginning - whether to start from the beginning or the end of each
- # partition.
- # max_bytes_per_partition - the maximum number of bytes to fetch from each partition
- # at a time.
+ # Can be called multiple times in order to subscribe to more topics.
+ #
+ # @param topics [String] one or more topics to subscribe to.
+ # @param start_from_beginning [Boolean] whether to start from the beginning or the end
+ # of each partition.
+ # @param max_bytes_per_partition [Integer] the maximum number of bytes to fetch from
+ # each partition at a time.
+ # @return [nil]
def subscribes_to(*topics, start_from_beginning: true, max_bytes_per_partition: 1048576)
topics.each do |topic|
subscriptions << Subscription.new(topic, start_from_beginning, max_bytes_per_partition)
end
end