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

Close event channel when consumer is closed #123

Merged
merged 1 commit into from
Feb 14, 2018
Merged

Close event channel when consumer is closed #123

merged 1 commit into from
Feb 14, 2018

Conversation

czchen
Copy link
Contributor

@czchen czchen commented Feb 8, 2018

This PR let Consumer to close consumer.events channel when calling Consumer.Close(). In this way, we can use the following code to consume data from Consumer, and exit automatically when Consumer.Close() is called.

for ev := range consumer.Events() {
    // do something here
}

@ghost
Copy link

ghost commented Feb 8, 2018

@confluentinc It looks like @czchen just signed our Contributor License Agreement. 👍

Always at your service,

clabot

@edenhill
Copy link
Contributor

Good fix, thanks!

@edenhill edenhill merged commit f5a17f1 into confluentinc:master Feb 14, 2018
@czchen czchen deleted the feature/close_consumer_chan branch March 20, 2018 03:53
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