developit / developit/web-worker

worker starting further workers

Đang mở
#12 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
1.2k
Fork
57
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.