TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Piscina – The Node.js Worker Pool

75 pointsby AquiGorkaabout 4 years ago

9 comments

chmod775about 4 years ago
Here&#x27;s my issue with this kind of &quot;magic&quot; API design:<p>It&#x27;s not clear when or how serialization happens.<p>Supposedly at some point the message I am sending to the worker is serialized, but this is not made clear to the user and it&#x27;s not made clear <i>when</i> this happens.<p>A well-designed library would synchronously serialize the given object the moment it is passed in or let the user explicitly handle serialization. But I don&#x27;t think that&#x27;s what is happening here.<p>It appears messages are serialized only eventually and when they are finally sent off to a worker.<p>If you accidentally pass mutable state in here, you&#x27;re in for a really confusing and fun debugging session. Likely it&#x27;ll be a production-only bug too, because during development and testing you&#x27;re unlikely to have the kind of message volume required to run into some modified-before-sent condition.<p>CTRL-F &quot;mutable&quot; and CTRL-F &quot;serialize&quot; gives no results, so I don&#x27;t think the designers thought of this or thought to warn users.
评论 #26565101 未加载
cjdellabout 4 years ago
What would be nice is a way of preventing the same job running multiple times concurrently. Like if I start a job and a job with the same parameters was already started milliseconds ago then it automatically awaits the already running job rather than starting another.
评论 #26561271 未加载
评论 #26560178 未加载
评论 #26561702 未加载
lyjackalabout 4 years ago
Interesting that it&#x27;s written in typescript and the readme doesn&#x27;t mention using it with typescript. I ran into annoyances with this recently trying out nodes worker threads in a typescript project. I was running with ts-node, but the worker thread didn&#x27;t know how to load a typescript file. There are some workarounds but they&#x27;re not elegant.
freeqazabout 4 years ago
Does anybody use this or anything similar? If so, what problems are you solving?
评论 #26560464 未加载
评论 #26560473 未加载
评论 #26559534 未加载
评论 #26559749 未加载
评论 #26559475 未加载
评论 #26560845 未加载
评论 #26559688 未加载
评论 #26559420 未加载
评论 #26559674 未加载
评论 #26559571 未加载
评论 #26559388 未加载
评论 #26559482 未加载
ericlewisabout 4 years ago
Neat! I’m friends with the creator of this and teased him a bit about the name (so many of these projects have weird names now a day)<p>The reason is: don’t wanna be boring from what I could glean.
评论 #26561907 未加载
timmitabout 4 years ago
u remind me my own researching project too.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;tim-hub&#x2F;pambdajs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tim-hub&#x2F;pambdajs</a>
revskillabout 4 years ago
Could i use it on a serverless platform ?
评论 #26561355 未加载
29athrowawayabout 4 years ago
Common mistake in stream code:<p><pre><code> -- .on(&#x27;end&#x27;) ++ .once(&#x27;end&#x27;)</code></pre>
hfktk4nrnabout 4 years ago
Is it just me, or do I see a trend in naming projects using romance language words (Italian&#x2F;Spanish&#x2F;France)?<p>Does it sound more exotic? Are these words less crowded?
评论 #26563596 未加载
评论 #26560357 未加载
评论 #26560286 未加载