natural icon indicating copy to clipboard operation
natural copied to clipboard

Bulk mode that is mindful of event loop

Open kibertoad opened this issue 2 years ago • 2 comments

Stemming of a larger text can take long time (10 seconds and more). Considering that Node.js runs on event loop, blocking operations prevent anything else from being processed.

Would it be possible to introduce async method which would automatically chunk text that exceeds X size and run it on different ticks, and then recombine everything back after done, in order to let event loop to process other requests?

kibertoad avatar Sep 19 '23 09:09 kibertoad

@Hugo-ter-Doest I can try to come up with a PR if such change would be accepted.

kibertoad avatar Sep 19 '23 16:09 kibertoad

@kibertoad idea is interesting, Want to add more, as js typcially lack in its computation power, so along with your idea , we can give more flexibility to the user by providing aws lambda support(or any other service which can be helpful at this point) which is good at scaling in case data become extremely large. Probably that will require configuration to be provided and accomodating those config in current implementation. Fascilitating these popular platforms can be a good selling point for this library as well. @Hugo-ter-Doest any thoughts on this?

MukeshSinghBisht avatar Sep 21 '23 04:09 MukeshSinghBisht