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

One exception and some nice-to-have changes #121

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

smurfix
Copy link
Contributor

@smurfix smurfix commented Nov 17, 2016

All changes should be self explanatory.
Please merge.

Matthias Urlichs added 4 commits August 25, 2016 10:10
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
Copy link
Contributor

@dzen dzen left a 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)
Copy link
Contributor

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)

Copy link
Contributor Author

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 …

Copy link
Contributor

@mwfrojdman mwfrojdman Nov 17, 2016

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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):
Copy link
Contributor

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)
Copy link
Contributor

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 :)

Copy link
Contributor Author

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

Copy link
Contributor

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

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.

4 participants