Any advice about adding a message queue for tasks like sending emails and other functions there can run later?
I have some thoughts on this. Making your hooks run async is a great start to not need to manage work in a queue. That said if you still do you can add any library you need to. Hell, you could even make a collection for
Tasksand run a cron job on your server that:
1) Uses the local API to query for new "tasks"
2) Calls the function associated with each kind of job
3) Updates the task with a complated timestamp, or increments a failed counter (typical queue workers will have a max failed attempts setting)
Star
Discord
online
Get dedicated engineering support directly from the Payload team.