Skip to content

Commit 6617f6d

Browse files
authored
allow stats cb reset (#342)
1 parent d5620ae commit 6617f6d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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.14.0 (Unreleased)
4+
- [Enhancement] Allow for setting `statistics_callback` as nil to reset predefined settings configured by a different gem (mensfeld)
45
* [Enhancement] Get consumer position (thijsc & mensfeld)
56
* [Enhancement] Provide `#purge` to remove any outstanding requests from the producer (mensfeld)
67
* [Enhancement] Update `librdkafka` to `2.2.0` (mensfeld)

lib/rdkafka/config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def self.logger=(logger)
5757
#
5858
# @return [nil]
5959
def self.statistics_callback=(callback)
60-
raise TypeError.new("Callback has to be callable") unless callback.respond_to?(:call)
60+
raise TypeError.new("Callback has to be callable") unless callback.respond_to?(:call) || callback == nil
6161
@@statistics_callback = callback
6262
end
6363

0 commit comments

Comments
 (0)