コード例 #1
0
ファイル: connection.py プロジェクト: aburan28/stormed-amqp
 def channel(self, callback=None):
     """get a Channel instance"""
     if self.status == status.OPENED:
         ch = Channel(channel_id=len(self.channels), conn=self)
         self.channels.append(ch)
         ch.open(callback)
         return ch
     else:
         raise ValueError('connection is not opened')
コード例 #2
0
 def channel(self, callback=None):
     """get a Channel instance"""
     if self.status == status.OPENED:
         ch_id = self._get_next_channel_id()
         ch = Channel(channel_id=ch_id, conn=self)
         self.channels[ch_id] = ch
         ch._open(callback)
         return ch
     else:
         raise AmqpStatusError('connection is not opened')
コード例 #3
0
ファイル: connection.py プロジェクト: GHigginson/stormed-amqp
 def channel(self, callback=None):
     """get a Channel instance"""
     if self.status == status.OPENED:
         id = self._next_channel_id()
         ch = Channel(channel_id=id, conn=self)
         if (id < len(self.channels)):
             self.channels[id] = ch
         else:
             self.channels.append(ch)
         ch.open(callback)
         return ch
     else:
         raise ValueError('connection is not opened')
コード例 #4
0
ファイル: connection.py プロジェクト: GHigginson/stormed-amqp
 def channel(self, callback=None):
     """get a Channel instance"""
     if self.status == status.OPENED:
         id = self._next_channel_id()
         ch = Channel(channel_id=id, conn=self)
         if id < len(self.channels):
             self.channels[id] = ch
         else:
             self.channels.append(ch)
         ch.open(callback)
         return ch
     else:
         raise ValueError("connection is not opened")