Reaction

A scheduled entity whose absolute occurrence time is owned by the entity itself.

The engine initializes a reaction before scheduling it, indexes nextOccurrence, and subscribes to that observable without replaying its current value. After the scheduler selects a finite occurrence, the engine calls execute. Observed model inputs synchronously mark the reaction dirty. When the enclosing model mutation completes, the engine invokes updateSchedulingAfterInvalidation once; the implementation owns that policy and communicates scheduling changes only by emitting a new nextOccurrence.

Inheritors

Properties

Link copied to clipboard
abstract var actions: List<Action<T>>

The Actions executed by this reaction.

Link copied to clipboard

Observes whether the reaction procedure can be selected and executed by the engine. This observable emits updates when that state changes. Reactions whose procedure includes checking occurrence-time conditions may remain executable even when those conditions will suppress their model effects.

Link copied to clipboard
abstract var conditions: List<Condition<T>>

The Conditions interpreted by this reaction's scheduling and execution policy.

Link copied to clipboard
abstract val host: ReactionHost<T>

The model entity hosting this reaction, fixed for the lifetime of the reaction. A host only registers reactions whose host is the host itself.

Link copied to clipboard

The absolute Time of the next occurrence.

Functions

Link copied to clipboard
abstract operator fun compareTo(other: Reaction<T>): Int
Link copied to clipboard
abstract fun dispose()

Disposes and releases the resources held by this object.

Link copied to clipboard
abstract fun execute()

Executes this reaction.

Link copied to clipboard
abstract fun initializationComplete(atTime: Time, environment: Environment<T, *>)

Activates reactive inputs after the environment is fully initialized and establishes the first occurrence.

Link copied to clipboard
infix fun Reaction<*>.shouldEqual(other: Reaction<*>)
Link copied to clipboard
Link copied to clipboard
abstract fun updateSchedulingAfterInvalidation(currentTime: Time)

Refreshes this reaction's scheduling after one or more observed model inputs changed.