def handler(message_type):
    """
    Decorator to mark a method as the handler for a specific message type.
    """
    def _actual_decorator(decorated_function):
        decorated_function.__message_type__ = message_type
        return decorated_function
    return _actual_decorator