Why Did I Build This?
"Generating concurrent viewing sessions for platforms like Twitch or Kick involves strict memory constraints and complex proxy routing. Instead of relying on bloated browser automation tools like Puppeteer or Selenium, I engineered this native Go utility. It automates the lifecycle of multiple low-latency `streamlink` instances, ensuring fault-tolerant proxy rotation and dynamic window management with minimal system overhead."
Architecture & Decisions
The orchestrator is built entirely on Go's concurrency primitives (`goroutines` and `sync.WaitGroup`). It dispatches worker threads that spawn `streamlink` subprocesses via `exec.CommandContext`. Process lifecycles and graceful teardowns (catching SIGTERM/SIGINT) are strictly managed through Go's `context` tree, guaranteeing no zombie processes are left behind. The engine dynamically calculates X/Y spatial geometry for cascading `mpv` windows and forces cacheless, low-latency playback profiles to drastically reduce RAM consumption per node.
Key Features
- 01.Goroutine-based worker pool with context-aware subprocess termination and synchronization
- 02.Dynamic proxy rotation (SOCKS5/HTTP) injected directly into Streamlink execution arguments
- 03.Automated spatial geometry calculation preventing overlapping `mpv` window instances
- 04.Robust OS signal interruption handling for clean, global teardown of all child processes