SubstitutionEngine

abstract class SubstitutionEngine<DataT>(dataFlowComponents: DataFlowComponents<DataT>)

Handles the logic of how data is created, when it's substituted instead of the previous value of a shared resource, and how it's substituted back

Inheritors

Constructors

Link copied to clipboard
constructor(dataFlowComponents: DataFlowComponents<DataT>)

Functions

Link copied to clipboard
abstract fun <T> withDataSubstitution(dataFactory: DataFactory<DataT>, body: () -> T): T

Substitutes the data provided by dataFactory instead of a shared resource (which is done by substitutor), executes body in this context and calls finalizer afterwards. Note that finalizer is called even in the case of exceptional completion of body.