4 ms·
This is a valid concern. I think it's just worth noting a few things: - Piscina will block the worker event loop indefinitely by default. This is their way of
by yakkomajuri 5y ago
This is a valid concern.
I think it's just worth noting a few things:
- Piscina will block the worker event loop indefinitely by default. This is their way of circumventing the native port.on('message', callback) API. It definitely shocked me a bit at first, but the team's maintainers include maintainers of Node itself (so this likely wasn't a beginner's mistake), and the decision makes sense given the scope of the project.
- We use Piscina in a way that's very custom to our needs, hence we've forked it. The solution here was one that both fit us very well and was quick to implement, which is why we picked it. We did also expose the useAtomics flag on our side, so it's possible to turn off all event loop blocking at the worker level very easily.