Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

handler: Migrate handlers collection #14

Merged
merged 9 commits into from
Oct 12, 2018
Merged

Conversation

tealeg
Copy link
Contributor

@tealeg tealeg commented Oct 12, 2018

This PR fixes: #9

I have taken the following steps:

  • Import the Handlers struct from kafka-go
  • Rename it "Collection"
  • Remove logging and metric functionality (this is too kafka-go specific).
  • Bring test coverage up to 100%

@tealeg tealeg added this to the feature-parity milestone Oct 12, 2018
@tealeg tealeg self-assigned this Oct 12, 2018
@tealeg tealeg requested review from asdine and yaziine October 12, 2018 09:48
Copy link
Contributor

@asdine asdine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

i := 0
count := len(h.handlers)
topics := make([]string, count)
for t := range h.handlers {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Why not using the for i, t := range h.handlers... syntax?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because handlers is a map, if you use that syntax i will be a key and t will be its value.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I thought it was a list. Sorry 🙊

type Collection struct {
sync.RWMutex

logger *logrus.Entry
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the logger field here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Removed.

@tealeg tealeg merged commit 77da3c9 into master Oct 12, 2018
@tealeg tealeg deleted the migrate-handlers-collection branch October 12, 2018 13:08
tealeg added a commit that referenced this pull request Nov 13, 2018
tealeg added a commit that referenced this pull request Nov 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

consumer: Import handlers type from kafka-go
3 participants