Closed ray-milkey closed 2 years ago
I'm not sure this is an issue. I think that is the point of a subscribe, you want to continue be listening for events. at least that is how it's implemented in the gNMI subscriptions I've seen. how would you do it ?
Is there a code example of what a working subscribe looks like? I can't find much from the docs.
@kuujo https://docs.onosproject.org/onos-config/docs/gnmi/ section Northbound Subscribe Request for Stream Notifications via gNMI
@Andrea-Campanella the Subscribe() call blocks. There is no way to listen to events without another thread. This would make this API very hard to use for languages that don't supply threading, like Python.
If you use the Subscribe() function on a gNMI client to request a subscription from an onos-config instance the request will block. You have to wrap it in a goroutine to be able to get back any events.