@muhkoo/theater-transcoder 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/worker.js +5 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muhkoo/theater-transcoder",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Drain a Muhkoo Theater transcode queue with NATIVE ffmpeg. Run it on any machine signed in as you to add transcoding power to your library.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/worker.js CHANGED
@@ -109,10 +109,11 @@ export function startWorker({ client, space, appKey, baseUrl }) {
109
109
  (async () => {
110
110
  log(`worker ${WORKER_ID} draining queue as ${client.auth.zk.user.username} (${WORKER_LABEL}, score ${MY_SCORE})`);
111
111
  // Announce capability so browsers defer manifest-ready jobs to us.
112
- const hello = () => void postSignal({ kind: "hello", score: MY_SCORE, worker: WORKER_LABEL });
113
- hello(); setInterval(hello, 12_000);
114
- // Real-time wake on new jobs; the poll below is the durable fallback.
115
- space.onMessage((e) => { const b = e?.message?.body; if (b?._t === "jobsig" && b.kind === "new" && b.src !== WORKER_ID) tick(); });
112
+ const hello = () => void postSignal({ kind: "hello", score: MY_SCORE, worker: WORKER_LABEL, native: true });
113
+ hello(); setInterval(hello, 4_000);
114
+ // Real-time wake on new jobs; also re-announce presence right away so the
115
+ // uploader learns a strong worker is here and defers to us. Poll is fallback.
116
+ space.onMessage((e) => { const b = e?.message?.body; if (b?._t === "jobsig" && b.kind === "new" && b.src !== WORKER_ID) { hello(); tick(); } });
116
117
  let ticking = false;
117
118
  async function tick() {
118
119
  if (ticking || stopped) return;