Skip to content

Commit

Permalink
Merge f50843c into f79f50b
Browse files Browse the repository at this point in the history
  • Loading branch information
mosquito committed Sep 17, 2018
2 parents f79f50b + f50843c commit b32b601
Show file tree
Hide file tree
Showing 33 changed files with 1,436 additions and 1,347 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Expand Up @@ -7,8 +7,6 @@ language: python

matrix:
include:
- python: 3.4
env: TOXENV=py34
- python: 3.5
env: TOXENV=py35
- python: 3.6
Expand Down
5 changes: 4 additions & 1 deletion aio_pika/__init__.py
Expand Up @@ -6,7 +6,10 @@
from .queue import Queue
from .robust_connection import connect_robust
from .exceptions import AMQPException, MessageProcessError
from .version import __author__, __version__, author_info, package_info, package_license, version_info
from .version import (
__author__, __version__, author_info, package_info,
package_license, version_info
)


__all__ = (
Expand Down
11 changes: 8 additions & 3 deletions aio_pika/adapter.py
Expand Up @@ -190,18 +190,23 @@ def _on_channel_cancel(self, channel):
def _create_channel(self, channel_number, on_open_callback):
log.debug('Creating channel %s', channel_number)
channel = Channel(self, channel_number, on_open_callback)
channel.add_on_cancel_callback(lambda method_frame: self._on_channel_cancel(channel))
channel.add_on_cancel_callback(
lambda method_frame: self._on_channel_cancel(channel)
)
return channel


class Channel(channel.Channel):
def __init__(self, connection, channel_number, on_open_callback=None):
super().__init__(connection, channel_number, on_open_callback=on_open_callback)
super().__init__(connection, channel_number,
on_open_callback=on_open_callback)
self._consume_results = {}
self._on_getempty_callback = None

def _on_eventok(self, method_frame):
callback = self._consume_results.pop(method_frame.method.consumer_tag, None)
callback = self._consume_results.pop(
method_frame.method.consumer_tag, None
)

if callback:
callback(method_frame)
Expand Down

0 comments on commit b32b601

Please sign in to comment.