TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Piscina – The Node.js Worker Pool

75 点作者 AquiGorka大约 4 年前

9 条评论

chmod775大约 4 年前
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 未加载
cjdell大约 4 年前
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 未加载
lyjackal大约 4 年前
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.
freeqaz大约 4 年前
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 未加载
ericlewis大约 4 年前
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 未加载
timmit大约 4 年前
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>
revskill大约 4 年前
Could i use it on a serverless platform ?
评论 #26561355 未加载
29athrowaway大约 4 年前
Common mistake in stream code:<p><pre><code> -- .on(&#x27;end&#x27;) ++ .once(&#x27;end&#x27;)</code></pre>
hfktk4nrn大约 4 年前
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 未加载