Run function after api endpoint is run

Options
A user creates a new record through an api endpoint.

Then, a lot of processing needs to take place.

Right now, I have all of the processing in the endpoint so the user has to wait on the front end for the end point to complete.

But, there is a lot of processing that is irrelevant to the front end user.

Is there a way to return a response to the user, and then continue processing code?

Ive thought about a chron job to take over and check every minute for unprocessed records, but would prefer to find a way to just have code continue either by transferring to a function or something else.

Comments