Zend certified PHP/Magento developer

How would I invoke an AWS lambda function asynchronously?

This is my first post on this community.

I am working on a serverless backend for my web application using AWS api gateway and lambda. I have a lambda function that is invoked by api gateway. Inside the lambda function, I am returning some information which the web application needs right away (or the app will appear laggy). I am also doing some task inside the function which is completely unrelated to what the web application needs to know. This task can take extremely long to complete and should not hold up everything. So my question is the following:

How can I run this task asynchronously?

Any tutorials or documentation that could help with this would be very much appreciated. Thank you very much!