waitAllStartJobs

fun Koin.waitAllStartJobs(dispatcher: CoroutineDispatcher = Dispatchers.Default)

Wait for all lazy module start jobs to complete using platform-specific blocking.

This function blocks the current thread until all lazy modules have finished loading. Behavior varies by platform:

  • JVM/Native: Uses true blocking with kotlinx.coroutines.runBlocking

  • JS: Uses GlobalScope.promise (not truly blocking, logs a warning)

Typically used after startKoin with lazyModules() to ensure all modules are loaded before proceeding.

Parameters

dispatcher

The coroutine dispatcher to use for waiting (default: Dispatchers.Default)

Example:

startKoin {
lazyModules(myLazyModule1, myLazyModule2)
}
KoinPlatform.getKoin().waitAllStartJobs()

See also

for the suspend version that works on all platforms