Models Cotonic
Because workers run as independent components it is not possible to directly call api's. Some api's are also not available to web workers. Models are special modules, or workers, which publish their data, or are ready to receive calls via mqtt topics.
The convention is that models provide their services via the following topic tree.
- model/+modelName/get/+
- Call topics. When the model receives a publish, it returns the answer to the reply topic.
- model/+modelName/post/+
- Topics used to post updates to the model.
- model/+modelName/delete/+
- Topics used to delete items managed by the model.
- model/+modelName/event/+
- Topics which the model publishes events on.