'Add the given callback at the given channel (if not present).'

def subscribe(self, channel, callback, priority=None):

    if (channel not in self.listeners):
        self.listeners[channel] = set()
    self.listeners[channel].add(callback)
    if (priority is None):
        priority = getattr(callback, 'priority', 50)
    self._priorities[(channel, callback)] = priority
