So I've built an app that uses an API.
When someone uses that API to submit some data to my database I would like them to be able to continue using the application as fast as possible. Now my problem is when they submit data I want to inform other users that the user has done this. The best way to achieve this in my eyes was push notifications.
However when they have submitted the data I go to collect all users that I want to send a push notification to and loop through them, if there are a lot of users the API will take a lot of time before the function has finished executing.
I want to be able to send data back to the client and still continue executing the PHP script since it has no use for the client to be waiting till this has finished. Is it somehow possible with PHP to asynchronously send data back and still continue executing the script?