Y
Y
Yuri2018-03-05 00:15:57
PHP
Yuri, 2018-03-05 00:15:57

Curl-multi, is it possible to add a thread when one of the running ones is released?

Good afternoon.
Interested in the ability to add a new thread when one of the executed threads is released. That is:
1. Added 50 threads;
2. 10 threads have successfully received a response;
What happens in most libraries:
3. Wait in do {} while (); completion of execution of all threads;
4. In the same loop, we get response.
What you need:
3. Add new 10 threads in place of 10 completed threads;
This way we get stable 50 threads, not 50, 49, ..., 0 -> 50, 49, ..., 0 -> ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Skobkin, 2018-03-05
@LazyDev

docs.guzzlephp.org/en/stable/quickstart.html#concu...
Just below the link is an example with GuzzleHttp\Pool.
Do you want that?
By the way, it also supports Curl as a backend.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question