multithreading - Real asynchronous / multithread request in PHP?
Get the solution ↓↓↓During the execution of my request, I will want to call an API in asynchronous mode, but I don't want to wait for this API to return to send the response back to the user. However, I still need to retrieve the response from the API for post processing.
To schematize:
- The client makes a request.
- The PHP script calls an API asynchronously.
- The PHP script sends a feedback to the user (eg: OK).
- The API responded, I retrieve the value to write to the database.
Is there a way in PHP to use asynchronism / multithreading which always executes after the request is complete as it does with C #?
I looked towards pThreads, but it looks like it is no longer maintained and I don't know why. I also don't know if pThreads would cause other unwanted problems in the application (potential incompatibilities).
Has anyone ever had the same problem?
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: call to undefined function illuminate\encryption\openssl_cipher_iv_length()
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.