-
Notifications
You must be signed in to change notification settings - Fork 22
stop consume functionality #193
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
base: master
Are you sure you want to change the base?
Conversation
There are also a few lint issues |
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.
@Adarsh-jaiss How did you test this? Can you please describe your test plan?
As for the test plan of this
Here's the unittest file:
Please do correct me, and tell me the suggested changes since i am also a beginner and trying to learning new stuff by doing :) |
@Adarsh-jaiss Did you run the unit test you wrote? Did it run successfully? The best way to learn is to try things -- you won't break anything. :) |
I have created a stopConsume method with self parameter, refefered in the issue #139
In this code :
The stopConsume method is added to the Consumer class. This method will cancel the task responsible for consuming messages, effectively stopping the automatic message consumption.
In the __consume method, we added a condition to check whether the consumer task (t_consume) is still running. If not, it will break out of the loop, ensuring that the consumption stops when stopConsume is called.