public boolean nextGeneration(long timeoutMillis, boolean isInitializing) {
        return acquireSnapshot(timeoutMillis, false, isInitializing);
    }
Use this for waiting for a new config generation, with the given timeout

Returns true if:

It is the first time nextGeneration() is called on this subscriber, and the framework has fetched config for all subscriptions. (Typically a first time config.)

or

All configs for the subscriber have a new generation since the last time nextGeneration() was called, AND they have the same generation. Note that
none of the configs have to be changed, but they might be.

You can check which configs are changed by calling {@link ConfigHandle#isChanged()} on the handle you got from {@link #subscribe(Class, String)}.

If the call times out (timeout 1000 ms), no handle will have the changed flag set. You should not configure anything then.

@param timeoutMillis timeout in milliseconds
@param isInitializing true if this the next generation is needed to create the initial configuration for the caller,
                      false if this is for reconfiguration
@return true if generations for all configs have been updated.
@throws ConfigInterruptedException if thread performing this call interrupted.
@throws SubscriberClosedException if subscriber is closed
config/src/main/java/com/yahoo/config/subscription/ConfigSubscriber.java