Goal

interface Goal<out T>

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

Types

Companion
Link copied to clipboard
common
object Companion

Functions

async
Link copied to clipboard
common
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.

reset
Link copied to clipboard
common
abstract fun reset()

Reset the computation

Properties

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

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

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

Inheritors

Data
Link copied to clipboard
StaticGoal
Link copied to clipboard
LazyGoal
Link copied to clipboard

Extensions

await
Link copied to clipboard
common
suspend fun <T> Goal<T>.await(): T
isComplete
Link copied to clipboard
common
val Goal<*>.isComplete: Boolean
launch
Link copied to clipboard
common
fun Goal<*>.launch(coroutineScope: CoroutineScope): Job