new Updater()
An updater may only update topics at or below the registration path of the TopicUpdateHandler from which it was produced.
The result will fail if the update was not successful. It is necessary for the topic to exist, and that the value type must be valid for the topic, for example a topic added with Metadata.Integer cannot accept a string value. Updates will also fail if the TopicUpdateHandler this updater was created from is in a
standbyor
closedstate.
Example
updater.update('foo/bar', 123).then(function() { // Update successful }, function(err) { // Update failed });
Methods
-
update(topicPath, value) → {Result.<undefined>}
-
Update a topic
Prefer #updateValue when updating a
Double
orInt64
topic. This method can infer the wrong data type when updating aDouble
topic with a value that does not have a fractional component.Parameters:
Name Type Description topicPath
String The topic to update value
Object The value to update the topic with Returns:
- The Result.<undefined> of the update call- Type
- Result.<undefined>
-
updateValue(topicPath, value, datatype) → {Result.<undefined>}
-
Update a topic with a specified data type.
Parameters:
Name Type Description topicPath
String The topic to update value
Object The value to update the topic with datatype
Datatype The data type to be used for encoding the value Returns:
- The Result.<undefined> of the update call- Type
- Result.<undefined>