waitForGeneration

fun waitForGeneration(targetGen: Long)

Waits for the target generation to become visible in the searcher. If the current searcher is older than the target generation, this method will block until the searcher is reopened, by another via ReferenceManager.maybeRefresh or until the ReferenceManager is closed.

Parameters

targetGen

the generation to wait for


fun waitForGeneration(targetGen: Long, maxMS: Int): Boolean

Waits for the target generation to become visible in the searcher, up to a maximum specified milli-seconds. If the current searcher is older than the target generation, this method will block until the searcher has been reopened by another thread via ReferenceManager.maybeRefresh, the given waiting time has elapsed, or until the ReferenceManager is closed.

NOTE: if the waiting time elapses before the requested target generation is available the current [SearcherManager] is returned instead.

Return

true if the targetGeneration is now available, or false if maxMS wait time was exceeded

Parameters

targetGen

the generation to wait for

maxMS

maximum milliseconds to wait, or -1 to wait indefinitely