def _handle(self, msg):
        """
        Pass a received message to the registered handlers.

        :param msg: received message
        :type msg: :class:`fatbotslim.irc.Message`
        """

        def handler_yielder():
            for handler in self.handlers:
                yield handler

        def handler_callback(_):
            if msg.propagate:
                try:
                    h = hyielder.next()
                    g = self._pool.spawn(handler_runner, h)
                    g.link(handler_callback)
                except StopIteration:
                    pass

        def handler_runner(h):
            for command in h.commands:
                if command == msg.command:
                    method = getattr(h, h.commands[command])
                    method(msg)

        hyielder = handler_yielder()
        try:
            next_handler = hyielder.next()
            g = self._pool.spawn(handler_runner, next_handler)
            g.link(handler_callback)
        except StopIteration:
            pass
def _handle ( self , msg ) : def handler_yielder ( ) : for handler in self . handlers : yield handler def handler_callback ( _ ) : if msg . propagate : try : h = hyielder . next ( ) g = self . _pool . spawn ( handler_runner , h ) g . link ( handler_callback ) except StopIteration : pass def handler_runner ( h ) : for command in h . commands : if command == msg . command : method = getattr ( h , h . commands [ command ] ) method ( msg ) hyielder = handler_yielder ( ) try : next_handler = hyielder . next ( ) g = self . _pool . spawn ( handler_runner , next_handler ) g . link ( handler_callback ) except StopIteration : pass
Pass a received message to the registered handlers.

        :param msg: received message
        :type msg: :class:`fatbotslim.irc.Message`