New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ActiveBrokers() method to Kafka AsyncProducer #187
Conversation
Signed-off-by: Sotirios Mantziaris <smantziaris@gmail.com>
Signed-off-by: Sotirios Mantziaris <smantziaris@gmail.com>
Signed-off-by: Sotirios Mantziaris <smantziaris@gmail.com>
Signed-off-by: Sotirios Mantziaris <smantziaris@gmail.com>
Signed-off-by: Sotirios Mantziaris <smantziaris@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #187 +/- ##
==========================================
- Coverage 84.40% 84.38% -0.02%
==========================================
Files 51 52 +1
Lines 3046 3068 +22
==========================================
+ Hits 2571 2589 +18
- Misses 397 399 +2
- Partials 78 80 +2
Continue to review full report at Codecov.
|
@gm42 you have breaking changes due to a refactoring of packages. All client code has now been moved to the client package. |
func (ap *AsyncProducer) ActiveBrokers() []string { | ||
brokers := ap.prodClient.Brokers() | ||
activeBrokerAddresses := make([]string, len(brokers)) | ||
for i, b := range brokers { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you consider using „copy“ for a slice ? And let go do the memory re-arrangement under the hood ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drakos74 can you make an example for this specific loop? I don't think copy
can be used here.
Closed in favor of #192 |
This PR adds an
ActiveBrokers()
method to KafkaAsyncProducer
. It also expands the GoDoc comment for Close() method and fixes a typo in an error message.Which problem is this PR solving?
Fixes #169