public boolean canSend(Message message, int pendingCount) {
        if (!super.canSend(message, pendingCount)) {
            return false;
        }

        long period = timer.milliTime() / PERIOD;

        while (currentPeriod < period) {
            if (allotted > 0) {
                allotted = 0.0;
            }

            allotted = allotted + PERIOD * desiredRate / 1000;
            currentPeriod++;
        }

        if (allotted > 0.0) {
            allotted -= 1;
            return true;
        }

        return false;
    }
Throttling policy that throttles sending based on a desired rate. It will
block messages if the current rate is higher than desired, but otherwise will
respect the static throttle policy's maximum window size.

Rate is measured from at most the last 60 seconds.
messagebus/src/main/java/com/yahoo/messagebus/RateThrottlingPolicy.java