BullMQ + TRPC
Curious how to configure BullMQ with TRPC correctly. Currently I have the queue, queueevents, and the worker inside a router. Though it works, I have a feeling its not the right approach?
3 Replies
I don't think you should have those in a router. BullMQ should be defined outside of tRPC, then you'll be able to queue new jobs from your tRPC routers
Ya, I actually moved BullMQ into its own node sever. Rather not have long-lasting processes like this in a NextJS app
Fair enough, i mean you can have it in the same node process using a custom nextjs server, you just can’t go serverless if you do that