akarneliuk / pygnmi

The pure Python implementation of the gNMI client.
https://training.karneliuk.com
BSD 3-Clause "New" or "Revised" License
127 stars 44 forks source link

Long running connections and is_alive method #46

Closed dmulyalin closed 2 years ago

dmulyalin commented 2 years ago

Hi,

Thank you for creating this great library.

I am in the process of integrating it with Salt Nornir Proxy Minion and planning to run long-live connections to devices, as a result would be good to have liveability detection of the connections, something like is_alive method.

To be honest, not sure if long-running connection is a good way to use gNMI protocol. To your opinion, are there any potential issues with that or it is better to use gNMI similar to RESTCONF - each set/get request is atomic and reinitiates connection to device using with ... as ..: constructs?

akarneliuk commented 2 years ago

Hello @dmulyalin ,

First of all, thanks a lot for your interest in integrating pygnmi with other projects. There is generally shall not be long stale connections applications, as a rule of a thumb. You might see in a separate thread discussion about long-living connections within telemetry subscription, without any activity.

I tend to think that, if your aim it to create configuration or poll information is to use repetitive ad-hoc commands. gNMI supports heartbeat itself, but it depends, whether it is implemented in particular vendor, you are running configuration against.

Best, anton

dmulyalin commented 2 years ago

Ok, thank you for clarification.