Answer the question
In order to leave comments, you need to log in
How to do multithreading?
Good afternoon.
Can you please tell me how to use multithreading in pure PHP now?
What is better to use?
I'm sketching a script to work with the API.
It will be essentially small, but since a lot of requests are received, it will linearly work for a long time.
There will be 2 functions:
1. I get a list of user IDs using the API
Then, for each of the received users, the second function will pass
2. Gets user information from another API. For everyone.
Accordingly, if it is linear, then it will interrogate them one by one users.
Is it possible to do something in several threads to speed up the execution of the script? So that 10-20 pieces are polled in parallel
Thanks in advance for the information
Answer the question
In order to leave comments, you need to log in
Maybe NodeJS? As far as I understand any multithreading in php is an emulation.
It’s not quite real in the node, but still better ..
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question