ReactionHost

interface ReactionHost<T>

A model entity owning Reaction membership.

Implementations notify the running simulation after membership actually changes. Consequently, callers only register or unregister reactions through their host: scheduler synchronization is not their responsibility.

Inheritors

Properties

Link copied to clipboard

The reactions registered with this host, in registration order; ObservableList.current is a snapshot.

Functions

Link copied to clipboard
abstract fun addReaction(reaction: Reaction<T>)

Registers reaction and notifies the running simulation when it was not already present. Fails if this is not the Reaction.host of reaction.

Link copied to clipboard
open fun Reaction<T>.remove()

Unregisters this reaction from its host, see removeReaction.

Link copied to clipboard
abstract fun removeReaction(reaction: Reaction<T>)

Unregisters reaction and notifies the running simulation when it was actually present.