Skip to content

Commit 2fc6ffa

Browse files
authored
YARD order and funding reference (#350)
* update readme * align yard tags order and add funding reference
1 parent fb56f26 commit 2fc6ffa

File tree

7 files changed

+28
-23
lines changed

7 files changed

+28
-23
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: ['https://karafka.io/#become-pro']

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Rdkafka Changelog
22

33
## 0.15.0 (Unreleased)
4+
- **[Feature]** Add Create and Delete ACL Feature To Admin Functions (vgnanasekaran)
45
- [Enhancement] Bump librdkafka to 2.3.0 (mensfeld)
56
- [Enhancement] Increase the `#lag` and `#query_watermark_offsets` default timeouts from 100ms to 1000ms. This will compensate for network glitches and remote clusters operations (mensfeld)
67

lib/rdkafka/admin.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,10 @@ def delete_topic(topic_name)
195195
# valid values are:
196196
# RD_KAFKA_ACL_PERMISSION_TYPE_DENY = 2
197197
# RD_KAFKA_ACL_PERMISSION_TYPE_ALLOW = 3
198-
# @raise [RdkafkaError]
199198
#
200199
# @return [CreateAclHandle] Create acl handle that can be used to wait for the result of creating the acl
200+
#
201+
# @raise [RdkafkaError]
201202
def create_acl(resource_type:, resource_name:, resource_pattern_type:, principal:, host:, operation:, permission_type:)
202203
closed_admin_check(__method__)
203204

@@ -300,9 +301,9 @@ def create_acl(resource_type:, resource_name:, resource_pattern_type:, principal
300301
# valid values are:
301302
# RD_KAFKA_ACL_PERMISSION_TYPE_DENY = 2
302303
# RD_KAFKA_ACL_PERMISSION_TYPE_ALLOW = 3
303-
# @raise [RdkafkaError]
304-
#
305304
# @return [DeleteAclHandle] Delete acl handle that can be used to wait for the result of deleting the acl
305+
#
306+
# @raise [RdkafkaError]
306307
def delete_acl(resource_type:, resource_name:, resource_pattern_type:, principal:, host:, operation:, permission_type:)
307308
closed_admin_check(__method__)
308309

@@ -407,9 +408,9 @@ def delete_acl(resource_type:, resource_name:, resource_pattern_type:, principal
407408
# valid values are:
408409
# RD_KAFKA_ACL_PERMISSION_TYPE_DENY = 2
409410
# RD_KAFKA_ACL_PERMISSION_TYPE_ALLOW = 3
410-
# @raise [RdkafkaError]
411-
#
412411
# @return [DescribeAclHandle] Describe acl handle that can be used to wait for the result of fetching acls
412+
#
413+
# @raise [RdkafkaError]
413414
def describe_acl(resource_type:, resource_name:, resource_pattern_type:, principal:, host:, operation:, permission_type:)
414415
closed_admin_check(__method__)
415416

lib/rdkafka/consumer.rb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,9 @@ def committed(list=nil, timeout_ms=1200)
259259
#
260260
# @param list [TopicPartitionList, nil] The topic with partitions to get the offsets for or nil to use the current subscription.
261261
#
262-
# @raise [RdkafkaError] When getting the positions fails.
263-
#
264262
# @return [TopicPartitionList]
263+
#
264+
# @raise [RdkafkaError] When getting the positions fails.
265265
def position(list=nil)
266266
if list.nil?
267267
list = assignment
@@ -438,9 +438,9 @@ def seek(message)
438438
#
439439
# @param list [TopicPartitionList] The TopicPartitionList with timestamps instead of offsets
440440
#
441-
# @raise [RdKafkaError] When the OffsetForTimes lookup fails
442-
#
443441
# @return [TopicPartitionList]
442+
#
443+
# @raise [RdKafkaError] When the OffsetForTimes lookup fails
444444
def offsets_for_times(list, timeout_ms = 1000)
445445
closed_consumer_check(__method__)
446446

@@ -537,9 +537,9 @@ def poll(timeout_ms)
537537
# If `enable.partition.eof` is turned on in the config this will raise an error when an eof is
538538
# reached, so you probably want to disable that when using this method of iteration.
539539
#
540-
# @raise [RdkafkaError] When polling fails
541540
# @yieldparam message [Message] Received message
542541
# @return [nil]
542+
# @raise [RdkafkaError] When polling fails
543543
def each
544544
loop do
545545
message = poll(250)
@@ -594,14 +594,15 @@ def each
594594
# @param bytes_threshold [Integer] Threshold number of total message bytes in the yielded array of messages
595595
# @param timeout_ms [Integer] max time to wait for up to max_items
596596
#
597-
# @raise [RdkafkaError] When polling fails
598-
#
599-
# @yield [messages, pending_exception]
600597
# @yieldparam messages [Array] An array of received Message
601598
# @yieldparam pending_exception [Exception] normally nil, or an exception
599+
#
600+
# @yield [messages, pending_exception]
602601
# which will be propagated after processing of the partial batch is complete.
603602
#
604603
# @return [nil]
604+
#
605+
# @raise [RdkafkaError] When polling fails
605606
def each_batch(max_items: 100, bytes_threshold: Float::INFINITY, timeout_ms: 250, yield_on_error: false, &block)
606607
closed_consumer_check(__method__)
607608
slice = []

lib/rdkafka/consumer/headers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def [](key)
2020
#
2121
# @private
2222
#
23-
# @param [librdkakfa message] native_message
23+
# @param [Rdkafka::Bindings::Message] native_message
2424
# @return [Hash<String, String>] headers Hash for the native_message
2525
# @raise [Rdkafka::RdkafkaError] when fail to read headers
2626
def self.from_native(native_message)

lib/rdkafka/consumer/topic_partition_list.rb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ def empty?
3636
# Add a topic with optionally partitions to the list.
3737
# Calling this method multiple times for the same topic will overwrite the previous configuraton.
3838
#
39+
# @param topic [String] The topic's name
40+
# @param partitions [Array<Integer>, Range<Integer>, Integer] The topic's partitions or partition count
41+
#
42+
# @return [nil]
43+
#
3944
# @example Add a topic with unassigned partitions
4045
# tpl.add_topic("topic")
4146
#
@@ -45,10 +50,6 @@ def empty?
4550
# @example Add a topic with all topics up to a count
4651
# tpl.add_topic("topic", 9)
4752
#
48-
# @param topic [String] The topic's name
49-
# @param partitions [Array<Integer>, Range<Integer>, Integer] The topic's partitions or partition count
50-
#
51-
# @return [nil]
5253
def add_topic(topic, partitions=nil)
5354
if partitions.nil?
5455
@data[topic.to_s] = nil
@@ -90,11 +91,11 @@ def ==(other)
9091

9192
# Create a new topic partition list based of a native one.
9293
#
94+
# @private
95+
#
9396
# @param pointer [FFI::Pointer] Optional pointer to an existing native list. Its contents will be copied.
9497
#
9598
# @return [TopicPartitionList]
96-
#
97-
# @private
9899
def self.from_native_tpl(pointer)
99100
# Data to be moved into the tpl
100101
data = {}
@@ -127,8 +128,8 @@ def self.from_native_tpl(pointer)
127128
#
128129
# The pointer will be cleaned by `rd_kafka_topic_partition_list_destroy` when GC releases it.
129130
#
130-
# @return [FFI::Pointer]
131131
# @private
132+
# @return [FFI::Pointer]
132133
def to_native_tpl
133134
tpl = Rdkafka::Bindings.rd_kafka_topic_partition_list_new(count)
134135

lib/rdkafka/producer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ def partition_count(topic)
165165
# @param timestamp [Time,Integer,nil] Optional timestamp of this message. Integer timestamp is in milliseconds since Jan 1 1970.
166166
# @param headers [Hash<String,String>] Optional message headers
167167
#
168-
# @raise [RdkafkaError] When adding the message to rdkafka's queue failed
169-
#
170168
# @return [DeliveryHandle] Delivery handle that can be used to wait for the result of producing this message
169+
#
170+
# @raise [RdkafkaError] When adding the message to rdkafka's queue failed
171171
def produce(topic:, payload: nil, key: nil, partition: nil, partition_key: nil, timestamp: nil, headers: nil)
172172
closed_producer_check(__method__)
173173

0 commit comments

Comments
 (0)