Closed hiddentao closed 8 years ago
@geekingfrog commented:
I think the easiest way would be to remove the async version. If someone needs to use the lib for giant inputs, a custom service or a different process will be needed anyway.
And btw, prefer setImmediate to nextTick to avoid starving the event loop (https://stackoverflow.com/questions/15349733/setimmediate-vs-nexttick)
Using setImmediate
now.
People can just use a webworker if they are running this in a browser so the async version is redundant there. In node.js we don't have native web worker support - in such instances
process.nextTick
would be better thansetTimeout
- so perhaps a shim for the latter is needed.Comments from @geekingfrog: