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')
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')
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')
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")