Better way to use bullmq for non-blocking background process #2469
Replies: 2 comments 2 replies
-
If "sendSMS" is very CPU intensive (although it seems like it should not be), then you can use sandboxed processors: https://docs.bullmq.io/guide/workers/sandboxed-processors |
Beta Was this translation helpful? Give feedback.
-
@manast thank you for replying, Actually, sendSMS is not CPU CPU-intensive job but it takes around 20-30 seconds to finish sending SMS to about 10,000 numbers looping over phone numbers fetched from a database. In addition, I tried to make the call |
Beta Was this translation helpful? Give feedback.
-
Hello friends, I am working on a web application using Sveltekit and using bullmq. The application uses
SMPP
protocol to send and receive SMS, and I am using bullmq mainly to do the sending SMS part as background service so that it won't block the front end while users use the web application.But I am not getting the result I am looking for, when the process of sending SMS starts (which triggers thousands of phone numbers). the front end freezes for some seconds until the process finishes, but I was expecting the front end would work without depending on what background service is running using bullmq. Let me share you some samples from my code:
Is there anything I missing to make the front end not be blocked while the job is running in the background?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions