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?
D
Dani;328d ago
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
B
b327d ago
Ya, I actually moved BullMQ into its own node sever. Rather not have long-lasting processes like this in a NextJS app
D
Dani;327d ago
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