Normally, a publish-subscribe pattern is about fetching content updates. But how do subscribers get initial content that was there before they subscribed for updates?
I'm using publish-subscribe examples within autobahn framework for my application. The publisher backend publishes a position of the robotic joint when the joint moves. The client frontend subscribes to the topic sometimes later. Due to the nature of the data, the initial value of the "topic" on the client is just as important as subsequent updates made by the publisher. So right after a successful connection is established, I'd like to fetch the "current" value of the topic.
Is there some type of design pattern within the framework that I can leverage to get the "current" value (the value prior to subscription)? I can think of some sort of separate RPC service for fetching it, but it seems that it will be going through a separate delivery channel. Ideally, I would want for the publisher to notice that I just subscribed and push the initial value to the individual client, or something of that sort, but that might be too much to ask, or is it not?
Aucun commentaire:
Enregistrer un commentaire