Live data from Hacker News

Piscina – The Node.js Worker Pool

github.com

11–20 of 51 posts

Re: Piscina – The Node.js Worker Pool

#11
post #2

Does anybody use this or anything similar? If so, what problems are you solving?

Knex, the SQL query builder, uses Tarn.js[1] for connection pooling to the db.

I've been using Tarn a bunch at work recently. We're doing some batch jobs, and I'm queuing work at each stage in Tarn.js pools. I created my own enqueue function that waits until the pool is less than a high-water mark in size before enqueueing. Then the pool has however many workers running.

Neither of these are off-thread pools. But they help a lot of for managing multiple async operations.

[1] https://github.com/vincit/tarn.js/

Re: Piscina – The Node.js Worker Pool

#12
post #10
post #2

Does anybody use this or anything similar? If so, what problems are you solving?

Yeah. I built Bree @ https://jobscheduler.net It has support for worker threads + cron + human strings GH: https://github.com/breejs/bree

This is cool. Our use case was very simple so we went with node-schedule but this may have more upsides. I've had trouble with the former. Thanks.

Re: Piscina – The Node.js Worker Pool

#14
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.

Re: Piscina – The Node.js Worker Pool

#16
post #14

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.

You could build a reasonably lightweight supervisor pattern that uses a parameter-derived hash for comparison to handle this kind of situation in your application too.

Might be easier and more flexible than asking the library to do it?

Re: Piscina – The Node.js Worker Pool

#17

Is it just me, or do I see a trend in naming projects using romance language words (Italian/Spanish/France)? Does it sound more exotic? Are these words less crowded?

I'm curious on why you call these languages "romance" languages.

"Piscina" is a Portuguese word for "pool", by the way.

Re: Piscina – The Node.js Worker Pool

#18

Is it just me, or do I see a trend in naming projects using romance language words (Italian/Spanish/France)? Does it sound more exotic? Are these words less crowded?

I'm curious on why you call these languages "romance" languages. "Piscina" is a Portuguese word for "pool", by the way.

To quote Wikipedia, "Romance languages (less commonly Latin languages, or Neo-Latin languages) are the modern languages that evolved from Vulgar Latin between the third and eighth centuries." "Piscina" is also "pool" in Romanian, which is, you guessed, a Romance language.

Re: Piscina – The Node.js Worker Pool

#19

Is it just me, or do I see a trend in naming projects using romance language words (Italian/Spanish/France)? Does it sound more exotic? Are these words less crowded?

I'm curious on why you call these languages "romance" languages. "Piscina" is a Portuguese word for "pool", by the way.

> I'm curious on why you call these languages "romance" languages.

That's what they're called: https://en.wikipedia.org/wiki/Romance_languages

Re: Piscina – The Node.js Worker Pool

#20

Is it just me, or do I see a trend in naming projects using romance language words (Italian/Spanish/France)? Does it sound more exotic? Are these words less crowded?

I'm curious on why you call these languages "romance" languages. "Piscina" is a Portuguese word for "pool", by the way.

[deleted]
Post reply on HN