LazyDeferred
Lazily invokes some the first time await or join is called.
This action is only invoked once. The caller's coroutine is used to execute this action.
val expensive = lazyDeferred { repository.getAll() }
suspend fun getExpensive() = expensive.await()
Content copied to clipboard
Since
0.12.0
Inheritors
Functions
Link copied to clipboard
fun <E> LazyDeferred<Set<E>>.asDataSource(priority: LazySet.DataSource.Priority = MEDIUM): LazySet.DataSource<E>
Link copied to clipboard
Immediately returns the deferred value if already completed.