'Creates a new Channel.
:param name: Name of the Channel.
:param description: Description of the Channel.
:param mode: Mode of the Channel (\'open\', \'semi-open\', or \'closed\').
:param rss_url: RSS URL for the Channel.
:return: Channel ID
:raises DuplicateChannelNameError if name already exists'

@call_on_reactor_thread
def create_channel(self, name, description, mode, rss_url=None):

    assert isinstance(name, basestring), (u'name    is    not    a    basestring:    %s' % type(name))
    assert isinstance(description, basestring), (u'description    is    not    a    basestring:    %s' % type(description))
    assert (mode in self._channel_mode_map), (u'invalid    mode:    %s' % mode)
    assert (isinstance(rss_url, basestring) or (rss_url is None)), (u'rss_url    is    not    a    basestring    or    None:    %s' % type(rss_url))
    for channel_object in self._channel_list:
        if (name == channel_object.name):
            raise DuplicateChannelNameError((u'Channel    name    already    exists:    %s' % name))
    channel_mode = self._channel_mode_map[mode]
    community = ChannelCommunity.create_community(self.dispersy, self.session.dispersy_member, tribler_session=self.session)
    channel_obj = ChannelObject(self.session, community)
    channel_obj.initialize()
    community.set_channel_mode(channel_mode)
    community.create_channel(name, description)
    self._channel_list.append(channel_obj)
    if (rss_url is not None):
        channel_obj.create_rss_feed(rss_url)
    self._logger.debug(u"creating    channel    '%s',    %s", channel_obj.name, hexlify(community.cid))
    return channel_obj.channel_id
