getOrDefault

abstract suspend fun getOrDefault(key: K, defaultValue: V): V

Returns the value corresponding to the given key if it exists or is currently being created, or defaultValue otherwise.

The function waits for the creation to complete if it is in progress. If the creation fails, the function returns defaultValue. Any unhandled exceptions inside the creation block will be thrown.