Replies: 7 comments 12 replies
-
I am not deeply familiar with Blitz internals and am by no means an expert in the area of background workers. So as someone who is very excited to use Blitz in production, I am wondering if you have the goal to make it so that developers can write jobs once and then easily switch the backing store via configuration / adapter libraries (similar to ActiveJob in Rails)? The question comes to mind because I think it would unlock a lot for Blitz developers as potentially all of these could happen without any worker code changes:
I believe that the first point is a particular challenge for frameworks that seek to be equally strong at serverful and serverless deployments. While cloud providers have their own recommendations (e.g., SQS + Lambda), 2nd tier serverless cloud providers such as Vercel and Netlify do not have standard background worker implementations yet. Perhaps in some cases, the adapters / worker implementations would only need to map from the Blitz API to popular libraries. For instance, the serverful Redis adapter could be a (hopefully) thin wrapper around BullMQ. |
Beta Was this translation helpful? Give feedback.
-
After spending the night trying to find something that fits with postgres I found this: https://github.com/timgit/pg-boss I'm a little concerned about not going through prisma, but the DB directly. So it might be that I end up having to convert |
Beta Was this translation helpful? Give feedback.
-
Disclaimer: I've not been using Blitz so far, but I've recently listened to an interesting Podcast (FSJam) and I'm generally trying to simplify our architecture. I'm a bit surprised background tasks and job queues are not yet supported – when reading the manifesto, my assumption was that this topis is already covered. So here's my usecase. We usually have two different kind of background tasks with our apps:
We currently use RabbitMQ/Celery, but the setup and maintenance is quite complicated. Something more lightweight would be awesome. I've been looking at Bull, but it's not convincing. Quirrel and Repeater don't seem to handle usecase 2 very well. graphile-worker looks quite ok. |
Beta Was this translation helpful? Give feedback.
-
I usually use Bull too (https://github.com/OptimalBits/bull). Typescript, baked by redis, easy to configure and use, gives enough control on jobs (promises, watch, cronjobs, scheduling, retry, etc.), you can put your workers in separate processes, control execution parallelism and you can even use bull-board (https://github.com/vcapretz/bull-board) to get a quick view of what's going on. |
Beta Was this translation helpful? Give feedback.
-
Just wanted to throw Quirrel into the ring: https://github.com/quirrel-dev Especially for serverless deployments, I think it's a very nice fit. Disclaimer: I'm the author |
Beta Was this translation helpful? Give feedback.
-
Hi, Just want to know if there's any news regarding background intensive tasks with Blitz JS as stated in the landing page:
I don't really understand the purpose of the quirrel solution suggested above... it seems to be a cron/queue app which call our own API, so any intensive task like sending 10.000 emails or generating PDFs would lock the main app thread anyway. To keep our blitz app monolithic without needing to develop a backend for intensive tasks, we need a solution to use Node's The ability to run a file Any progress on this point ? Thx |
Beta Was this translation helpful? Give feedback.
-
I would be fine with a simple way of calling the blitz console and some mutations. This way i could send emails via my Is there no easier way than this? https://javascript.plainenglish.io/how-i-automated-my-weekly-newsletter-using-blitz-js-and-cron-4c38ec244762 |
Beta Was this translation helpful? Give feedback.
-
We're starting to have people use Blitz with background workers and queues. At some point we want Blitz to have this functionality backed in, or at least really nicely integrated.
So this is a thread for people to post what they are doing and/or ask questions.
The first one I've seen is by @johncantrell97 on how to use BullMQ with Blitz when deploying it to a server (not serverless):
https://medium.com/@johncantrell97/background-workers-in-blitz-31fe5f3b6ce6
Beta Was this translation helpful? Give feedback.
All reactions