-
Notifications
You must be signed in to change notification settings - Fork 88
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
One exception and some nice-to-have changes #121
base: master
Are you sure you want to change the base?
Conversation
Set AMQP_{HOST,PORT,MGR_PORT, USER,PASS} to appropriate values. Defaults: localhost,5671,15672, guest,guest.
also use native exception printing
to reproduce: delete the queue on the server via command line or web frontend
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.
We should add a pylint test on travis :)
@@ -661,7 +661,7 @@ def basic_deliver(self, frame): | |||
@asyncio.coroutine | |||
def server_basic_cancel(self, frame): | |||
"""From the server, means the server won't send anymore messages to this consumer.""" | |||
consumer_tag = frame.arguments['consumer_tag'] | |||
consumer_tag = frame.arguments.get('consumer_tag',None) | |||
self.cancelled_consumers.add(consumer_tag) |
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.
what to do if we get None here ? (it misses a space between ,
and None
)
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.
Hmm. Probably cancel all consumers …
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.
How do you not get a consumer tag with a basic.cancel frame? It's always there
EDIT: Actually it's a parameter, not an argument, so frame.payload_decoder.read_xyz()
should be used to read it.
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.
OK … can you prepare a patch that actually works?
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.
This part is now fixed in commit 893f196.
@@ -199,6 +202,14 @@ def start_connection(self, host, port, login, password, virtualhost, ssl=False, | |||
|
|||
# for now, we read server's responses asynchronously | |||
self.worker = ensure_future(self.run(), loop=self._loop) | |||
def done_work(w): |
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.
that's interesting !
@@ -12,7 +12,8 @@ class AmqpConnectionTestCase(testcase.RabbitTestCase, unittest.TestCase): | |||
|
|||
@testing.coroutine | |||
def test_connect(self): | |||
_transport, proto = yield from connect(virtualhost=self.vhost, loop=self.loop) | |||
_transport, proto = yield from connect(virtualhost=self.vhost, loop=self.loop, | |||
host=self.host,port=self.port,login=self.login,password=self.password) |
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.
don't forget the spaces :)
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.
Bah. Will try to remember next time :-P
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.
I just created a branch with a pylint test ;)
any suggestion ? @RemiCardona @smurfix #122
All changes should be self explanatory.
Please merge.