developit / developit/web-worker

worker starting further workers

Abierto
#12 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
1.2k
Forks
57
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.