well, here's a pretty stupid direct implementation...
# coroutines
k
well, here's a pretty stupid direct implementation of what you wanted:
Copy code
suspend fun <K, V> Cache<K, V>.cached(key: K, valueSupplier: suspend () -> V) {
    get(key) { async(c = valueSupplier).get() }
}