Does "bull" utilize multicore as node.js runs single-threaded

Viewed 3230

according to this package https://github.com/OptimalBits/bull#documentation

The process function can also be run in a separate process. This has several advantages:

  • The process is sandboxed so if it crashes it does not affect the worker.
  • You can run blocking code without affecting the queue (jobs will not stall).
  • Much better utilization of multi-core CPUs.
  • Less connections to redis.

In order to use this feature just create a separate file with the processor. (..) This is a perfect way to run blocking code.

My Question is:

does Bull utilize automatically multi-Core CPU as node.js runs on Single-Thread. And if yes, does make it sense to utilize multicore with Bull to run background tasks like massive mongodb-updates (updating my user-profile-avatar would run in req/res loop where as the updates on many many reference documents like in the friendship collection should run in background) which can take minutes or hours, so the users will not even notice when it takes a few minutes or even hours until all users of the network see the new avatar. Or does they mean with blocking code, code which blocks the Event-Loop like cpu-heavy tasks and not I/O operations like database-queries.

I would appreciate every information about that.

1 Answers
Related