

def channel(self, channel_id=None, synchronous=False):
    "\n        Fetch a Channel object identified by the numeric channel_id, or\n        create that object if it doesn't already exist.  If channel_id is not\n        None but no channel exists for that id, will raise InvalidChannel.  If\n        there are already too many channels open, will raise TooManyChannels.\n\n        If synchronous=True, then the channel will act synchronous in all cases\n        where a protocol method supports `nowait=False`, or where there is an\n        implied callback in the protocol.\n        "
    if (channel_id is None):
        if ((len(self._channels) - 1) >= self._channel_max):
            raise Connection.TooManyChannels('%d channels already open, max %d', (len(self._channels) - 1), self._channel_max)
        channel_id = self._next_channel_id()
        while (channel_id in self._channels):
            channel_id = self._next_channel_id()
    elif (channel_id in self._channels):
        return self._channels[channel_id]
    else:
        raise Connection.InvalidChannel('%s is not a valid channel id', channel_id)
    rval = Channel(self, channel_id, self._class_map, synchronous=synchronous)
    self._channels[channel_id] = rval
    synchronous.add_close_listener(self._channel_closed)
    rval.open()
    return rval

dataset/ETHPy150Open agoragames/haigha/haigha/connection.py Connection.channel/VarMisuse@163/427 `rval`->`synchronous`