pamoja for TypeScript - v0.2.0
    Preparing search index...

    Class RuleEngine

    Runs a rule file off a link. listen checks that every output a rule drives was given and subscribes to every watched topic; each step handles one message, switching the outputs by name and publishing over the same link; run repeats it until stopped.

    Index

    The rules, deciding each reading as the engine hands it over.

    • get actuators(): string[]

      The outputs the rules drive, each once, in name order.

      Returns string[]

    • get topics(): string[]

      The topics the rules watch, each once, in name order.

      Returns string[]

    • Whether a rule's condition holds.

      Parameters

      • rule: string

        the rule's name.

      Returns boolean | null

      the state, or null for a name no rule has.

    • Checks the engine was given every output a rule drives, and subscribes to every watched topic.

      Returns Promise<void>

      when a rule drives an output the engine was not given, naming it.

    • Handles messages until stopped.

      Parameters

      Returns Promise<void>

      once the signal aborts, the messages run out, or the link ends.

      the failure of a message when no onError hears it.

    • Waits for one message and runs every rule that watches its topic.

      Parameters

      • OptionaltimeoutMs: number

        how long to wait; for good unless given.

      Returns Promise<profile.RuleFired[] | null>

      what fired, which is empty when the message set or cleared nothing, or null when no message arrived in time or the link has ended.

      when a reading on a watched topic does not decode to a finite number, or an action fails.