In my GSoC project (more about this here) I need to do a lot of ubus use.
In this case, I want to connect a series of services in a publish-subscribe model.
In a publish-subscribe you have two type of agents: publishers and subsribers.
Publishers send messages tagged with a specific topic.
Subscribers wait for messages about a specific topic.
Tue Bus is in charge of routing messages based on the topic from publishers to subscribers.
In our case, ubus will act as the Bus.
First, the publisher:
And this is the subscriber:
I still have to figure out how it works… will expand this post once I finish understanding everything.
In particular, I still don’t understand how the notify send an event with a “test.alarm” topic, but the subscribe just listens to “test”… maybe is listening to everything that starts with test.