def run(self):
        """Listen to the messages coming from the endpoint and
        dispatch them to the threads which sent them"""
        try:
            ReceiverThread.run(self)
        except:
            traceback.print_exc()
        
        # If we're here, it means that a stop has been requested:
        # unblock _all_ the waiting caller threads and force them
        # to fail in transaction()
        self.__lock.acquire()
        try:
            for xid, slot in self.__waitq.iteritems():
                del slot[1] # Force IndexError on the waiting threads
                slot[0].set()
            del self.__waitq # Force AttributeError on next transaction()
        finally:
            self.__lock.release()
Listen to the messages coming from the endpoint and
        dispatch them to the threads which sent them
recipes/Python/576520_Multithreaded_MultiplexerDemultiplexer_allow/recipe-576520.py