def rate_rule_factory(rate, length):
    """
    Return a rule which indicates whether to notify or not base on the rate

    Parameters
    ----------
    rate : float
        The rate at which to issue notifications. The number of notifications
        can be computed as:
            int(math.ceil(1./rate)
    length : int
        The size of the iterator

    Return
    ------
    rate_notif_rule

    Fallback
    --------
    span_rule_factory
    """
    last_update = [0]
    def rate_notif_rule(task):
        """
        Rule which issues a notification at a predifined rate
        Return
        ------
        should_notify : boolean
            Whether to notify
        """
        progress = task.progress
        delta = (float(progress - last_update[0])/length)
        if delta >= rate:
            last_update[0] = progress
            return True
        return False

    return rate_notif_rule