queue and trigger
Hello, I am developing a project and need to generate PDFs for users. To avoid losing data and distribute the load, I use “queues.”
Is it possible to configure “queue” processing without using cron, but immediately when a new message appears, and process them one by one?
This is available in Azure, but is it possible in Supabase?
Thank you for your answers and help.
3 Replies
Nothing built in.
You could possibly put a trigger on the the queue table and call an edge function from that. BUT you will still need a cron task to come along later if it fails as there would not be another event to automatically check the queue later.
Can I set a cron job to run every minute to launch the edge function? But I need to make sure that the function doesn't accumulate a lot of messages to process from the queue during constant calls.
You could have an edge function handle both a trigger call and a cron call and process empty entries in the queue. So the cron job would backup any missed/failed trigger calls.
There is also this by a Supabase user https://www.pgflow.dev/ Not sure if more than you need or not.
pgflow (Workflow Engine for Supabase)
pgflow
Dead-simple workflow orchestration for Supabase. Build AI workflows you can actually debug with <100ms startup and full observability.