Skip to content
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 Topics() and Partitions() to Consumer interface, and mock Consumer implementation. #431

Merged
merged 1 commit into from
Apr 20, 2015

Conversation

wvanbergen
Copy link
Contributor

This will allow you to implement most consumer use cases without a Client instance, and make them easier to test by adding them to the Consumer mock and allowing to stub values.

As discussed in #430, fixes #366. @Shopify/kafka


// Partitions returns the sorted list of all partition IDs for the given topic.
// This methods delegates to the internal Client instance.
Partitions(topic string) ([]int32, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than mention delegation (technical aspect) mention that they are "the same as" and "provided for convenience" or something (UX aspect).

@eapache
Copy link
Contributor

eapache commented Apr 20, 2015

Doc string comment, but otherwise LGTM

wvanbergen added a commit that referenced this pull request Apr 20, 2015
Add Topics() and Partitions() to Consumer interface, and mock Consumer implementation.
@wvanbergen wvanbergen merged commit 3534171 into master Apr 20, 2015
@wvanbergen wvanbergen deleted the consumer_topics_partitions branch April 20, 2015 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Consumer.ConsumeTopic(topic, offset)
2 participants