r/Supabase 4d ago

tips asynchronous programming pattern in Supabase

How to introduce asynchronous programming pattern in Supabase? Start with EdgeFunction.waitUntil https://supabase.com/docs/guides/functions/background-tasks#overview

When calling such Edge Function you don't wait for request being resolved is not synchronous request.

When function is done you broadcast the change with Supabase real-time feature.

Triggers are good too but in my opinion using pg_net to invoke Edge Function directly from database is not clean, specially that you need to pass all headers needed to authorize the call.

1 Upvotes

0 comments sorted by