Package modulecheck.utils.lazy

Types

Link copied to clipboard
interface LazyDeferred<T>
Link copied to clipboard
internal class LazyDeferredImpl<T>(val action: suspend () -> T, val lock: Mutex) : LazyDeferred<T>
Link copied to clipboard
interface LazyResets<out T : Any> : Lazy<T> , Resets
Link copied to clipboard
internal class LazyResetsImpl<out T : Any>(val resetManager: ResetManager, val valueFactory: suspend () -> T) : LazyResets<T>
Link copied to clipboard
interface LazySet<out E> : Flow<E> , LazySetComponent<E>
Link copied to clipboard
interface LazySetComponent<out E>
Link copied to clipboard
class ResetManager(val delegates: MutableCollection<Resets> = mutableListOf())
Link copied to clipboard
interface Resets

Functions

Link copied to clipboard
fun <E> Lazy<Set<E>>.asDataSource(priority: LazySet.DataSource.Priority = MEDIUM): LazySet.DataSource<E>
fun <E> Flow<E>.asDataSource(priority: LazySet.DataSource.Priority = MEDIUM): LazySet.DataSource<E>
fun <E> LazyDeferred<Set<E>>.asDataSource(priority: LazySet.DataSource.Priority = MEDIUM): LazySet.DataSource<E>
Link copied to clipboard
fun <T> suspend () -> T.asLazyDeferred(): LazyDeferred<T>
Link copied to clipboard
suspend fun <T> Collection<LazyDeferred<T>>.awaitAll(): List<T>
Link copied to clipboard
suspend fun <T : B, E : B, B> LazySet<T>.containsAny(elements: Collection<E>): Boolean
suspend fun <T : B, E : B, B> LazySet<T>.containsAny(elements: LazySet<E>): Boolean
Link copied to clipboard
internal fun <E> createLazySet(children: Collection<LazySet<E>>, sources: Collection<LazySet.DataSource<E>>): LazySet<E>
Link copied to clipboard
fun <E> dataSource(priority: LazySet.DataSource.Priority = MEDIUM, factory: suspend () -> Set<E>): LazySet.DataSource<E>
Link copied to clipboard
fun <E> dataSourceOf(vararg elements: E, priority: LazySet.DataSource.Priority = MEDIUM): LazySet.DataSource<E>
Link copied to clipboard
fun <E> emptyDataSource(): LazySet.DataSource<E>
Link copied to clipboard
fun <E> emptyLazySet(): LazySet<E>
Link copied to clipboard
fun <T> lazyDeferred(action: suspend () -> T): LazyDeferred<T>

Lazily invokes action the first time await or join is called.

Link copied to clipboard
inline fun <T : Any> ResetManager.lazyResets(noinline valueFactory: suspend () -> T): LazyResets<T>
Link copied to clipboard
fun <E> lazySet(vararg children: LazySetComponent<E>): LazySet<E>
fun <E> lazySet(children: Collection<LazySetComponent<E>>): LazySet<E>
@JvmName(name = "lazySetSingle")
fun <E> lazySet(priority: LazySet.DataSource.Priority = MEDIUM, dataSource: suspend () -> E): LazySet<E>
fun <E> lazySet(priority: LazySet.DataSource.Priority = MEDIUM, dataSource: suspend () -> Set<E>): LazySet<E>
Link copied to clipboard
fun <E> Collection<LazySetComponent<E>>.toLazySet(): LazySet<E>
fun <E> Flow<E>.toLazySet(priority: LazySet.DataSource.Priority = MEDIUM): LazySet<E>
Link copied to clipboard
fun <T> unsafeLazy(initializer: () -> T): Lazy<T>