Commit Graph

4 Commits

Author SHA1 Message Date
Zach Clendenen
5ccafb361d refactor(streaming): drain spawned tasks in the job runner for every task, build the abandoned read on the live one, and drop the reaper's extra config parse (simplify) 2026-09-18 16:37:05 -05:00
Zach Clendenen
ca4ba4ee9a fix(streaming): keep a reap going past one failing container, give it the hold ceiling, keep no per-minute history, and share the abandoned-session read (code-review) 2026-09-18 16:28:02 -05:00
Zach Clendenen
9ee6bd4950 feat(streaming): reap abandoned streaming sessions every minute
A session whose heartbeat went stale was only torn down when a new claim
found every container of its platform held, so a player who left without
the pagehide release landing kept the emulator running. A scheduled task
now sweeps every configured container and hands stale sessions to the
existing abandoned-session teardown, which is made public for it.
2026-09-18 16:28:02 -05:00
Georges-Antoine Assi
f78348da0f refactor(streaming): move the endpoint's domain layer into handler/streaming
endpoints/streaming.py had grown to 3778 lines, but only about a third of
that was routes. The rest was a second copy of the layer handler/streaming
already exists to hold: broker verbs, webstation protocol translation,
state and save and memory-card transfer, session teardown.

Split it along those seams rather than by route, and give claim_session
the same treatment: its 406 lines are now four named phases.

Cross-module calls go through the module (states.pull_state_to_library,
commands.stop) instead of imported names, so one definition site is what
tests patch and what every caller reads.

No route path, scope or response model changed, so the OpenAPI schema is
untouched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-05 18:47:18 -04:00