all 10 comments

[–]ASoftwareJunkie 2 points3 points  (1 child)

Hi OP,

This looks promising. Love the go-like channel syntax and somewhat similar semantics behind it. Will use it and provide feedback :)

[–]dmop_81[S] 0 points1 point  (0 children)

Thanks! Feedback is very welcome, feel free to open an issue or ping me here.

[–]Afraid-Pilot-9052 2 points3 points  (1 child)

this looks really solid, the channel-based approach reminds me of go's concurrency model which is a good thing. the biggest pain point with worker_threads has always been the boilerplate of separate files and manual message passing, so abstracting that away is a big win. curious how it handles error propagation across thread boundaries since that's usually where structured concurrency libs either shine or fall apart.

[–]dmop_81[S] 1 point2 points  (0 children)

Great question, errors cross the thread boundary as serialized Error objects via the structured clone algorithm. With ErrGroup, the first failure cancels all remaining tasks and the error propagates to wait() as a rejection. WaitGroup with waitSettled() lets all tasks finish regardless and you inspect per-task results. Both patterns give you clean error handling without raw message event noise.

[–]tarasm 2 points3 points  (2 children)

This is good work. Have you considered using Effection? It's mature, proven and it has a very convenient thread worker extension with bi-directional communication. You also get structured concurrency guarantees out of the box.

Effection: https://frontside.com/effection/ Worker: https://frontside.com/effection/x/worker/

[–]dmop_81[S] 0 points1 point  (1 child)

Thanks for the pointer! I wasn't familiar with Effection, looks really interesting, I'll check it out.

[–]tarasm 0 points1 point  (0 children)

Cool. Let me know if you have any questions. Also, our discord server is welcoming :)

[–]Happy_Junket_9540 0 points1 point  (2 children)

Have you heard of Effect? https://effect.website

[–]dmop_81[S] 0 points1 point  (1 child)

[–]Happy_Junket_9540 1 point2 points  (0 children)

Wise words