getOrPut

open suspend override fun getOrPut(key: K, creationFunction: suspend (key: K) -> V?): V?

Returns the value for key if it exists in the cache, its creation is in progress, or it can be created by creationFunction. This returns null if a value is not cached and cannot be created. You can imply that the creation has failed by returning null. Any unhandled exceptions inside creationFunction won't be handled.