developit / developit/web-worker

worker starting further workers

オープン
#12 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
1.2k
フォーク
57
PR マージ指標
30日以内にマージされた PR はありません

説明

I recently ran into a bad trap: I had another `require('web-worker')` in the code of the child and not only in the parent. This doesn't work, because the `workerThread` function is then executed again. The symptom is that messages are received twice in the worker.

This was hard to figure out. Note that this is not really a user's error, because a web worker is normally allowed to start another web worker. So it makes sense in general. (In my code, I could simply comment the bad `require` out, though.)

I guess that you need to split `node.js` into two files for this, because the main/worker dichotomy doesn't work anymore when workers can start workers.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。