Fire and Forget kind of request

Dear coders, In Yii2, I am trying to achieve the following thing. Is this possible?

There is a form in Once admin fills this form and clicks on the save button, it got saved to the database.

after $model->save() method

I got 1000+ users array. In for each loop I call one URL


(hosted at another place with high configured server)

On that URL I have added a code that sends an email, to write some note and use some 3rd party API for supplied user_id which takes 3-6 seconds to complete the task.

Now the issue,

The pointer will take the first ID from the array by loop and call the URL. After getting a response for the first ID, the pointer will call URL for the second ID. Again it waits for the response for the second ID and so on.

Is there any way we can touch the URL and not wait for a response from

The pointer will take the first ID from the array by loop and call the URL, then grab the second ID and call the URL, again grab the third ID and call the URL and so on. and Both are our server. We can make necessary in both code files.

Note: I know fire and forgot request would create 1000 process in which is absolutely fine. The server is capable of handling more users.

A person’s most useful asset is not a head full of knowledge, but a heart full of love. An ear ready to listen and a hand willing to help others.

I believe you can achieve this with Curl functions.

Curl multi should do the trick.

I have not done this myself, but you will find many posts about this, such as;