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, via a fixed upper bound is enforced for the value array per property name. New values will be ignored if the upper bound is reached and are logged as errors.
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, 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
nmea0183sentenceParser
Code 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, via a fixed upper bound is enforced for the value array per property name. New values will be ignored if the upper bound is reached and are logged as errors.