def augment_on_message(self, handler):
        """
        :return:
            a function wrapping ``handler`` to refresh timer for every
            non-event message
        """
        def augmented(msg):
            # Reset timer if this is an external message
            is_event(msg) or self.refresh()

            # Ignore timeout event that have been popped from queue prematurely
            if flavor(msg) == '_idle' and msg is not self._timeout_event.data:
                return

            return handler(msg)
        return augmented