Skip to content

Add property filter to broker signal subscription #351

Description

@fvacek

.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:

  1. signal method equals method subscribed
  2. signal path starts with path subscribed

Proposed change is to add third option:

  1. 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"})

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions