Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: remove references to `rs_attrs`

...

Code Block
linenumberstrue
  rule collection_subscriptions {
    select when wrangler child_initialized
    pre {
      eci = event:attr("eci");
      collection_eci = get_wellKnown_eci(eci);
    }
    if collection_eci then noop();
    fired {
      raise grouper event "need_subscriptions"
        attributes event:attrattrs("rs_attrs").put("collection_eci",collection_eci);
    }
  }

...

This KRL code will respond to the internal event, expecting the collection_eci and the child_specs given to wrangler earlier (wrangler renames it rs_attrs for some reason).

Code Block
linenumberstrue
  rule collection_subscription_requests {
    select when grouper need_subscriptions
    foreach by_prefix(event:attr("name_prefix")) setting(room_name,tag_id)
    pre {
      eci = building:eci(tag_id);
      wellKnown_Tx = get_wellKnown_eci(eci).klog("wellKnown_Tx");
    }
    if wellKnown_Tx then every {
      event:send({"eci":eci,"domain":"wrangler","type":"subscription",
        "attrs": { "wellKnown_Tx": event:attr("collection_eci"),
          "Rx_role": "member", "Tx_role": "collection",
          "name": tag_id, "channel_type": "subscription" }
      })
    }
  }

...