Skip to content

Commit e1881d1

Browse files
committed
allow pending_subscription events
1 parent a225c71 commit e1881d1

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

packages/pico-engine/krl/io.picolabs.subscription.krl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,13 @@ ent:established [
7070
]
7171
*/
7272
wellknown_Policy = {
73-
name: "wellknown",
74-
event: {
75-
allow: [
76-
{domain: "wrangler", type: "subscription"}
77-
]
73+
"name": "wellknown",
74+
"event": {
75+
"allow": [
76+
{"domain": "wrangler", "type": "subscription"},
77+
{"domain": "wrangler", "type": "pending_subscription"}
78+
]
79+
}
7880
}
7981
autoAcceptConfig = function(){
8082
ent:autoAcceptConfig.defaultsTo({})
@@ -133,9 +135,10 @@ ent:established [
133135
rule create_wellKnown_Rx{
134136
select when wrangler ruleset_added where rids >< meta:rid
135137
pre{ channel = wellKnown_Rx() }
136-
if(channel.isnull() || channel{"type"} != "Tx_Rx") then
138+
if(channel.isnull() || channel{"type"} != "Tx_Rx") then every{
137139
engine:newPolicy( wellknown_Policy ) setting(__wellknown_Policy)
138140
engine:newChannel(pico_id = meta:picoId, name = "wellKnown_Rx", type = "Tx_Rx", policy_id = __wellknown_Policy{"id"}) //should be wrangler:createChannel(...)
141+
}
139142
fired{
140143
raise Tx_Rx event "wellKnown_Rx_created" attributes event:attrs;
141144
}

0 commit comments

Comments
 (0)