The PropertyValues mechanism provides a means for passing configuration type values between different components running in the server process such as plugins and input connections.
A plugin can both emit values and listen for values emitted by others.
The difference between the PropertyValues mechanism and Event Emitters in NodeJs is that when onPropertyValues is called, the callback() function will be invoked and passed an array containing all of the previous values for that property name, starting with the initial value of undefined. If no values have been emitted for that property name the callback will be invoked with a value of undefined.
*
PropertyValue has the following structure:
additional PGN definitions for propietary or custom PGNs
Code handling incoming PropertyValues should be fully reactive due to:
Plugins being able to emit PropertyValues when they activated and / or started
There being no defined load / startup order for plugins / connections.
So even if all plugins / connections emit during their startup, you cannot depend on a specific PropertyValue being available. It may be present when your code starts or it may arrive after your code has started.
Note: The PropertyValues mechanism is not intended to be used for data passing on a regular basis, as the total history makes it a potential memory leak.
To safeguard against a component accidentally emitting regularly, the server enforces a fixed upper bound of 1000 values on one count shared by all property names. The count includes each name's initial undefined, which is added the first time a name is emitted or subscribed to. Once the bound is reached, emitPropertyValue throws to the emitting plugin.
The PropertyValues mechanism provides a means for passing configuration type values between different components running in the server process such as plugins and input connections.
A plugin can both emit values and listen for values emitted by others.
The difference between the PropertyValues mechanism and Event Emitters in NodeJs is that when
onPropertyValuesis called, thecallback()function will be invoked and passed an array containing all of the previous values for that property name, starting with the initial value ofundefined. If no values have been emitted for that property name the callback will be invoked with a value ofundefined. * PropertyValue has the following structure:Note that the value can be also a function.
This mechanism allows plugins to offer extensions via "Well Known Properties", for example
nmea0183sentenceParserCode handling incoming PropertyValues should be fully reactive due to:
So even if all plugins / connections emit during their startup, you cannot depend on a specific PropertyValue being available. It may be present when your code starts or it may arrive after your code has started.
Note: The PropertyValues mechanism is not intended to be used for data passing on a regular basis, as the total history makes it a potential memory leak.
To safeguard against a component accidentally emitting regularly, the server enforces a fixed upper bound of 1000 values on one count shared by all property names. The count includes each name's initial
undefined, which is added the first time a name is emitted or subscribed to. Once the bound is reached,emitPropertyValuethrows to the emitting plugin.