p-limit
The gist
p-limit | The gist | |
---|---|---|
2 | 26 | |
1,693 | 5,212 | |
- | 3.1% | |
4.2 | 9.7 | |
6 months ago | 4 days ago | |
JavaScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
p-limit
-
Batch uploading images
What you're looking for is called parallel execution with a concurrency limit — execute asynchronous code in parallel but not more than X at the same time. You'd want to use a library to help with the concurrency limit. A popular one is p-limit.
-
Beware of Promise.all
For system calls where you want to limit the number of parallel executions, no matter how long they take, there is the simple p-limit library:
The gist
-
Object Narrowing in Typescript with Graphile Worker
Graphile worker has been great for me because it's a library that works with Postgres that allows me to queue jobs and execute them on the server without adding too many additional layers of complexity for being able to accomplish async tasks. (I'm aware of how popular bull is, but I don't want to add another data-store only for async tasks)
-
Job Schedulers for Node: Bull or Agenda?
Bull is currently in maintenance mode, we are only fixing bugs. For new features check BullMQ, a modern rewritten implementation in Typescript. You are still very welcome to use Bull if it suits your needs, which is a safe, battle-tested library.
-
Are there any generally accepted standards for inter-microservice communication? Or does everyone just go it their own?
I use bullmq with node
-
Next.js background jobs
You might consider using a queue for processing the request. I've found bullMQ, which works with Redis, to be a nice developer experience.
-
What is a good background scheduler?
BullMQ is a pretty solid choice: https://github.com/taskforcesh/bullmq It's the successor of Bull: https://github.com/OptimalBits/bull
-
How to schedule tasks in a Node.js app 🕙
BullMQ
-
First time building microservice-based application
For Node.JS you can use something like BullMQ (https://github.com/taskforcesh/bullmq) and then dispatch jobs to the message queue with your worker handling the jobs. You can read about an example for Bull MQ here (https://deadsimplechat.com/blog/best-nodejs-schedulers/#2-bull)
-
Is my health check endpoint good enough?
bullmq seems like an open issue
-
Help implementing Heroku Data For Redis (+bull & throng) / `ioredis`
In order to try and mitigate the OOMs. I read the Background Jobs in Node.JS with Redis blog post and implemented Heroku Data For Redis with ioredis, BullMQ and Throng,
- BullMQ – fastest, most reliable, Redis-based distributed queue for Node
What are some alternatives?
p-throttle - Throttle promise-returning & async functions
bull - Premium Queue package for handling distributed jobs and messages in NodeJS.
bree - Bree is a Node.js and JavaScript job task scheduler with worker threads, cron, Date, and human syntax. Built for @ladjs, @forwardemail, @spamscanner, @cabinjs.
Bee-Queue - A simple, fast, robust job/task queue for Node.js, backed by Redis.
agenda - Lightweight job scheduling for Node.js
better-queue - Better Queue for NodeJS
growthbook - Open Source Feature Flagging and A/B Testing Platform
RedisSMQ - A simple high-performance Redis message queue for Node.js.
kue - Kue is a priority job queue backed by redis, built for node.js.
node-resque - Node.js Background jobs backed by redis.
Conveyor MQ - A fast, robust and extensible distributed task/job queue for Node.js, powered by Redis.