Throttling
The throttle clause is used to:
-
Restrict the number of updates sent to reference topic subscribers, thus reducing network utilisation or the processing each subscriber must do.
-
Constrain the rate at which a reference topic is updated, when its source topic is updated
-
Restrict the rate at which client sessions can observe changes to reference topic values using the fetch API
The throttle clause is optional and has the following form:
throttle to <X> updates every <period>
where X is a positive integer, and period is a positive integer followed by a time unit (seconds, minutes, or hours).
For example, the following topic view specification maps all topics below the path a to reference topics below the path b, but updates the value of each reference topic at most twice every 5 seconds
map ?a// to b/<path(1)> throttle to 2 updates every 5 seconds
To improve readability, the throttling clause allows 1 update as an alternative to 1 updates, and every second as an alternative to every 1 seconds (the same applies to other time units).
For example, the following topic view specification maps all topics below the path a to reference topics below the path b, but updates the value of each reference topic at most once every hour:
map ?a// to b/<path(1)> throttle to 1 update every hour