andywer / andywer/threads.js

Tasks stuck and pool blocked

Aberta
#254 18 comentários 0 reações 0 responsáveis Ver no GitHub
help wanted question
Linguagem predominante
TypeScript
Estrelas
3.5k
Forks
173
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Hello, I'm having this weird behaviour where tasks are queued but the function itself is not running, and runningTasks just end up pilling up...
Keep in mind that I have not changed anything in my code..

```js
console.log('1')
this[pool].queue(async worker => {
console.log('2')
let m = worker[method]
console.log(m)
if (!m) return "Method doesn't exist";
console.log('3')
q = await m(item)
console.log('4')
return q;
})
console.log('5')
await this[pool].completed()
console.log('6')
return q;
```

and from the worker file:

```
const workerFunctions= {
async gen(c) {
console.log('FUNCTION RUNNING')
..................
}
...........
}
expose(workerFunctions)
```

Behaviour:
**1
2
[Function]
3
5**

The thing is, the exposed function is not being executed at all (**FUNCTION RUNNING** is never logged) and the pool just ends up having more and more runningTasks pilling up....

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.