Skip to content
All projects

Go Concurrent Streamlink Orchestrator

A highly concurrent Go orchestrator that leverages goroutines and the Context API to manage multiple proxied Streamlink subprocesses for automated HLS stream viewing.

Performance & metrics

  • Eliminates heavy browser rendering overhead by piping raw HLS streams directly into hardware-accelerated mpv instances
  • Context-bound execution ensures an immediate $O(1)$ teardown signal across all active subprocesses, strictly preventing memory leaks

Why I built it

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

  • Goroutine-based worker pool with context-aware subprocess termination and synchronization
  • Dynamic proxy rotation (SOCKS5/HTTP) injected directly into Streamlink execution arguments
  • Automated spatial geometry calculation preventing overlapping mpv window instances
  • Robust OS signal interruption handling for clean, global teardown of all child processes

Bots & Automation

Lain Discord Bot (Rust)

A high-performance, asynchronous Discord bot written in Rust, featuring targeted message delivery and strict RBAC (Role-Based Access Control) for administrators.

  • Rust
  • Serenity
  • Discord API

Bots & Automation

Telegram Lein Bot

An automated Telegram assistant equipped with custom command trees and a competitive, state-tracking trivia module.

  • Python
  • Aiogram
  • Telegram API

Bots & Automation

Discord Tarot & Astrology Bot

An automated server-management and entertainment bot capable of autonomously generating over 30 targeted channels and broadcasting specialized daily content.

  • JavaScript
  • Node.js
  • Discord.js

Need something similar?

I can build a system like this for you, too.

Describe your project in a few sentences, and we'll work out the right approach and an estimated scope together.