You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.app/broker/currentClient:subscribe() can have two params currently
path
method
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.
A new pattern parameter will be added, when pattern is specified, then the path parameter is ignored. pattern parameter can hold glob pattern plus globstar (**). Signals with paths matching pattern will be subscribed.
Sub-broker note
When subscription with pattern is requested, then broker must split pattern to local and sub-broker path. One possible implementation is:
foreach subrokers mountpoint
remove last part of the pattern after slash, until it matches moutpoint
matching part of pattern is local pattern, rest of pattern must be subscribed in subbroker
if local part ends with **, then ** must be prepended also to subbroker pattern
.app/broker/currentClient:subscribe()
can have two params currentlypath
method
I suggest to provide third optional parameter
property
, which will behave like additional subscription filter. Notificaton is currently delivered to client if:method
equalsmethod
subscribedpath
starts withpath
subscribedProposed change is to add third option:
path
ends withproperty
subscribedThis 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 callsubscribe
for everyalarm
node. With this change implemented, one can callsubscribe
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"})
The text was updated successfully, but these errors were encountered: