public long pollDelayMs(String id, long now) {
        long throttleDelayMs = throttleDelayMs(id, now);
        if (isConnected(id) && throttleDelayMs > 0) {
            return throttleDelayMs;
        } else {
            return connectionDelay(id, now);
        }
    }
Return the number of milliseconds to wait, based on the connection state and the throttle time, before
attempting to send data. If the connection has been established but being throttled, return throttle delay.
Otherwise, return connection delay.
@param id the connection to check
@param now the current time in ms
clients/src/main/java/org/apache/kafka/clients/ClusterConnectionStates.java