tiqi-group / pydase

A flexible and robust Python library for creating, managing, and interacting with data services, with built-in support for web and RPC servers, and customizable features for diverse use cases.
MIT License
0 stars 1 forks source link

Add connection component #92

Closed mosmuell closed 4 months ago

mosmuell commented 5 months ago

Is your feature request related to a problem? Please describe. If not configured correctly, services crash when the connection to a device gets lost. This might cause trouble and is not easily debuggable as the frontend is unreachable.

Describe the solution you'd like To solve this problem, a component could be introduced that allows the user to define what it means that the device is connected, and define how to connect to the device. The service will then automatically check if the device is connected and try to reconnect. The frontend will show the component regardless of whether the device is connected or not. If it is not connected, the component will show some user-defined message and greyed-out content.

mosmuell commented 5 months ago

The component could be called Connection or so. This would be an ABC and needs implementation of connect() and is_available(). Concrete implementations could include TCPConnection or SerialConnection which define those methods already and just need user input in the constructor (hostname or serial port, respectively).