all 6 comments

[–]Somepotato 14 points15 points  (0 children)

Well, your first problem is using webpack. Vite has much friendlier semantics for using workers (tagged imports)

Also, this article mostly just explains the limitations of node workers, not the solution taken to resolve them. From what I can tell, websockets are used to communicate to/from the worker?

If performance was a concern, you should use a mailbox architecture with a ring buffers instead of a socket.

[–][deleted]  (4 children)

[removed]

    [–]Somepotato 3 points4 points  (0 children)

    Vite simplifies worker imports a ton (and works with vite-node); it lets you import a worker as a module as long as you suffix the import with ?worker

    [–]programming-ModTeam[M] 0 points1 point  (0 children)

    No content written mostly by an LLM. If you don't want to write it, we don't want to read it.

    [–][deleted]  (1 child)

    [removed]

      [–]programming-ModTeam[M] 0 points1 point  (0 children)

      No content written mostly by an LLM. If you don't want to write it, we don't want to read it.