.app/broker/currentClient:subscribe() can have two params currently
I suggest to provide third optional parameter property, which will behave like additional subscription filter. Notificaton is currently delivered to client if:
- signal
method equals method subscribed
- signal
path starts with path subscribed
Proposed change is to add third option:
- signal
path ends with property subscribed
This change enables client to subscribe not only method but also method of some property.
Use-case:
We wand to subscribe chng signal of all alarms in shv tree but not other properties changes. Only way how to achieve this currently is to call subscribe for every alarm node. With this change implemented, one can call subscribe only once.
Before:
.app/broker/currentClient:subscribe({"path": "foo/bar1/alarm", "method": "chng"})
.app/broker/currentClient:subscribe({"path": "foo/bar2/alarm", "method": "chng"})
.app/broker/currentClient:subscribe({"path": "foo/bar/baz/alarm", "method": "chng"})
After:
.app/broker/currentClient:subscribe({"path": "foo", "method": "chng", "property": "alarm"})
.app/broker/currentClient:subscribe()can have two params currentlypathmethodI suggest to provide third optional parameter
property, which will behave like additional subscription filter. Notificaton is currently delivered to client if:methodequalsmethodsubscribedpathstarts withpathsubscribedProposed change is to add third option:
pathends withpropertysubscribedThis change enables client to subscribe not only method but also method of some property.
Use-case:
We wand to subscribe
chngsignal of all alarms in shv tree but not other properties changes. Only way how to achieve this currently is to callsubscribefor everyalarmnode. With this change implemented, one can callsubscribeonly once.Before:
.app/broker/currentClient:subscribe({"path": "foo/bar1/alarm", "method": "chng"}).app/broker/currentClient:subscribe({"path": "foo/bar2/alarm", "method": "chng"}).app/broker/currentClient:subscribe({"path": "foo/bar/baz/alarm", "method": "chng"})After:
.app/broker/currentClient:subscribe({"path": "foo", "method": "chng", "property": "alarm"})