-
-
Notifications
You must be signed in to change notification settings - Fork 927
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 accept parameter to SimpleQueue class #1140
Conversation
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.
please add tests
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.
Do we already have tests to cover this? can we update? Just let me know and i can help you
Hi @drsantos20. You can start adding tests here: https://github.com/celery/kombu/blob/60dc3456368a06ed4125ea9eac9c06e7fcf5cffe/t/unit/test_simple.py I would put it to Both test_SimpleQueue and test_SimpleBuffer classes. |
2634352
to
c274b33
Compare
c274b33
to
2e18b7c
Compare
I have added unittests and fixed slightly the PR. Please review. @celery/core-developers |
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.
A few minor changes which I think would make this better. I'd also like to see a test for what happens if we pass in an empty list/set for the accept
kwarg.
kombu/simple.py
Outdated
producer = messaging.Producer(channel, exchange, | ||
serializer=serializer, | ||
routing_key=routing_key, | ||
compression=compression) | ||
super().__init__(channel, producer, | ||
consumer, no_ack, **kwargs) | ||
consumer, no_ack, accept) |
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.
Why has this lost the **kwargs
passthrough? We still accept them in the method signature so I assume we still need to pass them along to be cooperative.
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.
The kwargs are redundant. If you have a look to __init__
definition of parent class you will see parameters only that are explicitly used:
16 class SimpleBase:
17 Empty = Empty
18 _consuming = False
19
20 def __enter__(self):
21 return self
22
23 def __exit__(self, *exc_info):
24 self.close()
25
26 def __init__(self, channel, producer, consumer, no_ack=False, accept=None):
hence the **kwargs
is totally useless here.
@maybe-sybr I have implemented your comments. |
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.
lgtm, thanks @matusvalo
We haven't done an RC for kombu like we have with celery, so this could arguably land but I'll leave that to @thedrow since he's managing the releases. |
please add 'accept' parameter to SimpleQueue class