connector: wanted(port) says whether anyone watches or reads a port
Docs / docs (push) Successful in 31s
Playwright Tests / test-playwright (1, 2) (push) Failing after 1m5s
Playwright Tests / test-playwright (2, 2) (push) Failing after 20s
pre-commit / pre-commit (push) Failing after 2m30s
Test Backend / test-backend (3.12) (push) Failing after 4m52s
Test Backend / test-backend (3.14) (push) Failing after 4m36s
Compose Smoke Test / test-compose (push) Failing after 24s
Playwright Tests / merge-reports (push) Failing after 2m25s

This commit is contained in:
Melvin Strobl
2026-10-27 15:20:24 +01:00
parent 90f1f288d2
commit 79142b16d8
4 changed files with 68 additions and 0 deletions
+14
View File
@@ -144,6 +144,20 @@ new frames arrive. Use durable storage for recordings.
Local screens receive pushed live frames; portal screens fetch the bytes.
Choose a modest poll rate for remote viewing.
`self.wanted(port)` says whether anyone wants what a port publishes right
now. That is a dashboard tile on screen, a portal screen, or a node of a
running flow reading its message. Check it before fetching a frame so a camera
sends nothing while nobody watches:
```python
async def poll(self):
if not self.wanted("frame"):
return None
...
```
On a remote worker it is always true, since the worker cannot see who watches.
## Keeping state across restarts
Keep connections and device handles in node attributes. Store short strings