Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add KafkaConsumer#close #2

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

Merged
merged 1 commit into from
Jul 15, 2015

Conversation

ucarion
Copy link

@ucarion ucarion commented Jul 9, 2015

See mumrah#426

def close(self):
"""Close this consumer's underlying client."""
self._client.close()

Choose a reason for hiding this comment

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

Is there anything else we would need to reset on close()? Not sure, but perhaps partition offset?

Copy link
Author

Choose a reason for hiding this comment

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

As I understand it, close is meant to be a way to deallocate IO resources associated with a consumer. You can't re-open a consumer once it's closed, so I don't think it's necessary to worry about the internal state of a closed consumer, only resources the consumer is leaking/holding onto.

Edit: offsets are stored in OffsetsStruct, which is just a named tuple of ints. Nothing to close/deallocate in there.

@ecanzonieri
Copy link

cool, +1
I'm going to merge this pr

ecanzonieri added a commit that referenced this pull request Jul 15, 2015
@ecanzonieri ecanzonieri merged commit c9ae06d into Yelp:master Jul 15, 2015
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.

2 participants