Goal

interface Goal<out T>

Lazy computation result with its dependencies to allowing to stat computing dependencies ahead of time

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val deferred: Deferred<T>?

Returns current running coroutine if the goal is started. Null if the computation is not started.

Link copied to clipboard
abstract val dependencies: Collection<Goal<*>>
Link copied to clipboard

Functions

Link copied to clipboard
abstract fun async(coroutineScope: CoroutineScope): Deferred<T>

Get ongoing computation or start a new one. Does not guarantee thread safety. In case of multi-thread access, could create orphan computations.

Link copied to clipboard
suspend fun <T> Goal<T>.await(): T
Link copied to clipboard
fun Goal<*>.launch(coroutineScope: CoroutineScope): Job
Link copied to clipboard
abstract fun reset()

Reset the computation