Provider loop discovery almost finished

Provider lookup will lookup on startup, do the healthcheck until the
stream starts and also restart on stream closure or provider stall
This commit is contained in:
2026-09-12 23:28:15 +01:00
parent 196e1d8916
commit 528c62288a
8 changed files with 114 additions and 19 deletions
+31
View File
@@ -0,0 +1,31 @@
# Provider Discovery
```
NewControlPanel()
go telemService.FindProvider() - has a callback for onFind
|
|iterates over the known providers
|
onFind
telemService.SwitchProvider() - activates the found provider
|
|-→ Create a background job while the stream hasn't initiated to listened
| for data, otherwise the connection might die before we start streaming
| ↓
| go telemService.ProviderMonitor()
↓ | |
/-→waits--\ if the provider stops we this healthcheck is stopped
\_________/ we clear the provider and once the stream starts
go back to the
FindProvider()
```
The provider discovery routine starts on `tui/tui.go`.
`FindProvider` is called here and it starts a background job.
On successful discovery the background job calls the `SwitchProvider` method
and dies.
## Provider stalls
A provider stalls once there is no new data.
After stalling