I have an API that receives requests and then responds with 200 OK. I need to save the requests to a database table and then immediatly trigger a function to respond to the request. The problem is once I return 200 OK that function exits, so I need to do it asynchronously. What is the best way to do this, maybe using the task scheduler, or is there a way to asynchronously call another function just before the 200 returns, that doesn't block that return?
The problem is i cannot wait 30 seconds to honor the request, it needs to be borderline immediate. Can I use AMP somehow in CL4, for asynch calls, is there an example of this anywhere?