taoqf / node-html-parser

A very fast HTML parser, generating a simplified DOM, with basic element query support.
MIT License
1.12k stars 112 forks source link

Usage with worker threads #184

Closed FabianL1 closed 2 years ago

FabianL1 commented 2 years ago

Hi there,

I'm a big fan of this library. Just wanted to know if there is a way to use this library with worker threads? That would be amazing.

Best, Fabian

nonara commented 2 years ago

Hi Fabian! Thank you for the kind words.

I imagine it would work well with that. I've considered doing it, but have written an implementation yet. Off the top of my head, I would say create your threads with an instance of NHP in each, then setup a messaging system to send parse instructions and receive the results back.

Hope that helps, and I'd love to hear about it if you get it working.