admin管理员组

文章数量:1431033

I have a typical NestJS application and I integrated BullMQ to make use of queues for the following cases:

  1. Triggering emails and push notifications
  2. Making database reads and writes at specific dates and times (for example: updating a calendar event status).

I came across this and from what I understood, I should be going for a separate Node process or a worker thread only if there are heavy synchronous computations (parallelism). Since all of my functionalities are asynchronous and there are no "heavy computation" (no stuff like image compression or video conversion going on), should I still go for a separate process/worker? I assume this is a case of concurrency?

Also, I'm confused as to what's considered synchronous or asynchronous: let's say I have a large list of user items that I loop through and perform tasks like triggering emails to each item through Promise.map. Is that async (concurrent) or sync (parallel)? I ask this because if I had to implement a heavy computation like image processing and wrap it in an async scope, it would still block the main thread. So would my case of looping also block the thread then?

本文标签: