Subscript for watching a node or things in ThingsDB. A successful run request will respond with a
OK (17) package.
IDs are the thing ID’s you want to watch.
The socket needs to be authorized before for sending a
See the auth example for how to authorize a socket connection.
As an example we assume that we want to watch a thing with ID 3 for changes. Instead of a single ID, we could at as much ID’s as we wanted.
ThingsDB will throw a
WARNING event to you socket connection in case some given ID does not exist within the given collection scope.
Other ID’s will be watched and the response to you watch request will still be
This is the data we want to pack:
Serializing the above using MessagePack results in the following
Now we create the header, for this example we just use ID 0:
Sending the Query package
Responding OK package
See the watching documentation for more information.