z25 / pyZOCP

Python ZOCP implementation (Z25 Orchestration Control Protocol)
GNU Lesser General Public License v3.0
33 stars 5 forks source link

On subscription should the current value be transferred? #77

Open sphaero opened 9 years ago

sphaero commented 9 years ago

node1:

self.register_string("state", "HUNGRY", "rwe")

node2:

self.signal_subscribe(self.uuid(), "state1", peer, "state")

Now node2 will not have the value of node1's state in its state1 parameter. Of course node2 can get the value from the capability tree but what behaviour is wanted?

fieldOfView commented 9 years ago

I think that - if properly documented - the current situation is the best; there may not be a "current" value, the value may only be relevant when the node emits the value. Currently there is no standard response to a subscribe event (though it would be beneficial for a node to be able to deny a subscription). But node1 can use on_peer_subscribe to fire off a signal to node2 when it subscribes.