3 ms·
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
by rektide 6y ago
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/ https://github.com/vincit/tarn.js/