pika: channel.connection must be available (in pika it's channel.handler.connection)

This commit is contained in:
Ask Solem 2010-12-05 15:12:46 +01:00 committed by Ask Solem
parent f202a35b25
commit 5494317a04
1 changed files with 6 additions and 2 deletions

View File

@ -110,7 +110,9 @@ class Channel(channel.Channel):
class BlockingConnection(blocking_adapter.BlockingConnection): class BlockingConnection(blocking_adapter.BlockingConnection):
def channel(self): def channel(self):
return Channel(channel.ChannelHandler(self)) c = Channel(channel.ChannelHandler(self))
c.connection = self
return c
def ensure_drain_events(self, timeout=None): def ensure_drain_events(self, timeout=None):
return self.drain_events(timeout=timeout) return self.drain_events(timeout=timeout)
@ -121,7 +123,9 @@ class AsyncoreConnection(asyncore_adapter.AsyncoreConnection):
Super = asyncore_adapter.AsyncoreConnection Super = asyncore_adapter.AsyncoreConnection
def channel(self): def channel(self):
return Channel(channel.ChannelHandler(self)) c = Channel(channel.ChannelHandler(self))
c.connection = self
return c
def ensure_drain_events(self, timeout=None): def ensure_drain_events(self, timeout=None):
# asyncore connection does not raise socket.timeout when timing out # asyncore connection does not raise socket.timeout when timing out