getOrPut

suspend fun <T : AutoCloseable> getOrPut(key: String, estimatedBytes: Long, loader: suspend () -> T): ModelLease<T>(source)

Leases the model under key, loading it with loader if it is not resident. If another caller loaded the same key concurrently, the extra copy is closed and the resident one is returned.