Hello i have some method in Main Controller which run by 3rd party API callback(POST data) and i'm catch this and update one single order row in SQL and i need return response code "200" on success or any other code(500) if not ok, to the 3rd party API service.
But after this i need run some heavy scripts which can insert/update 100-1000+ SQL's and something can go wrong and in this reason i can't put this in middle of API callback method, i prefer run this separately only after return/output to the API done. So as not to accidentally return the wrong answer to the api and no do long wait(maybe timeout be), because API callback run only once for the order.
How i can run another method after this method triggered by API fully complete(return/output sent)? I want do this without CRON or Daemons because it's limited.