Generic base class for reactions. The type parameter T denotes the type of the argument list of the react function that that is applied to when this reaction gets triggered.

Marten Lohstroh marten@berkeley.edu

Type Parameters

Hierarchy (view full)

Constructors

Properties

active: boolean = false

Indicates whether or not this reaction is active. A reaction become active when its container starts up, inactive when its container shuts down.

args: [...ArgList<T>[]]

The arguments to be passed to react and late.

next: undefined | PrioritySetElement<number>

Pointer to the next reaction, used by the runtime when this reaction is staged for execution at the current logical time.

parent: Reactor
trigs: Variable[]

The ports, actions, or timers, which, when they receive values, will trigger this reaction.

Methods

  • Invoke the react function in the appropriate sandbox and with the argument list that was specified upon the construction of this reaction object.

    Returns void

  • Return the priority of this reaction. It determines the execution order among reactions staged for execution at the same logical time.

    Returns number

  • Return whether or not this reaction has priority over another.

    Parameters

    • another: undefined | PrioritySetElement<number>

      Reaction to compare this reaction's priority against.

    Returns boolean

  • Set a deadline for this reaction. The given time value denotes the maximum allowable amount by which logical time may lag behind physical time at the point that this reaction is ready to execute. If this maximum lag is exceeded, the late function is executed instead of the react function.

    Parameters

    • deadline: TimeValue

      The deadline to set to this reaction.

    Returns this

  • Set for reaction priority, to be used only by the runtime environment. The priority of each reaction is determined on the basis of its dependencies on other reactions.

    Parameters

    • priority: number

      The priority for this reaction.

    Returns void

  • Return whether another, newly staged reaction is equal to this one. Because reactions are just object references, no updating is necessary. Returning true just signals that the scheduler shouldn't stage it twice.

    Parameters

    Returns boolean