4 Commits

Author SHA1 Message Date
Deluan
faa4acf583 refactor(stream): make TranscodingThrottle an internal component of mediaStreamer
The throttle is an implementation detail of mediaStreamer, not a
dependency that needs to be injected. Remove it from the constructor
and wire providers; create it internally via a singleton. This
simplifies the API and keeps Release() unexported.
2026-03-25 08:27:23 -04:00
Deluan
c7865ff159 fix(stream): make TranscodingThrottle a singleton and optimize hot path
- Use sync.Once to ensure a single shared throttle instance across
  all wire-injected consumers (subsonic + public routers)
- Optimize Acquire() fast path: TryAcquire before touching the atomic
  backlog counter, avoiding unnecessary atomic ops when slots are free

refactor(stream): use singleton package for TranscodingThrottle
2026-03-25 08:21:37 -04:00
Deluan
b018d7b634 feat(stream): wire TranscodingThrottle into MediaStreamer 2026-03-25 07:58:44 -04:00
Deluan
58f7959204 feat(stream): add TranscodingThrottle with tests 2026-03-25 07:55:44 -04:00