Initial implementation of remote library system

This commit is contained in:
patben8 committed 2026-10-04 17:13:24 +02:00
1 parent e8a53eee07
commit e5fb0f0dbb
65 files changed
+6000 -183

No files matched your search

+15
View File
@@ -34,9 +34,24 @@ def _watch_parent_and_exit() -> None:
pass
except Exception:
pass
_release_remote()
os._exit(0)
def _release_remote() -> None:
"""Hand back a remote library's session on the way out, so the next
computer opens it at once instead of waiting out the lease (or being asked
to take over a laptop that has already quit). Best-effort and brief."""
try:
from konduktor.app_state import STATE
if STATE.remote is not None:
STATE.remote.stop()
STATE.remote.client.release(timeout=2.0)
except Exception:
pass
def _free_port() -> int:
"""Grab an unused loopback port. There's a tiny bind→close→rebind race, but
it's harmless on 127.0.0.1 for a single local sidecar."""