top | item 32581943

(no title)

zebnyc | 3 years ago

Can you clarify "main thread"? Do you have a code example? Asking as Node is single threaded.

Thanks

discuss

order

numlock86|3 years ago

Most likely using the cluster module and your favorite IPC module.

https://nodejs.org/api/cluster.html

christophilus|3 years ago

Using cluster and worker threads. The code is here, but completely undocumented, as I’ve been side tracked by a few other things[0]. I’m currently looking into porting that project to Bun, so it’s possibly dead in its current form.

I was planning on turning that into a library, but Bun nerd sniped me.

You need the “hey” tool to run the benchmarks[1] the way that I was running them.

[0] https://github.com/chrisdavies/sql3

[1] https://github.com/rakyll/hey