martinmajor / async-request Goto Github PK
View Code? Open in Web Editor NEWAsynchronous cURL library for PHP with reasonable API
Asynchronous cURL library for PHP with reasonable API
Hey @MartinMajor
I have just noticed that some syntax like method return type
is only available in PHP7. How are you going to address for people who are using an older version of php?
Hey @MartinMajor,
Would you mind publishing this project on https://packagist.org so that I can add it as a dependency in my project I try it out?
Thanks.
that's ok as long as it always returns CURLM_OK, which it is supposed to do, in lack of errors,
but per https://curl.haxx.se/libcurl/c/libcurl-errors.html it can also return other values, for example:
CURLM_OK (0)
Things are fine.
CURLM_OUT_OF_MEMORY (3)
You are doomed.
CURLM_UNKNOWN_OPTION (6)
curl_multi_setopt() with unsupported option (Added in 7.15.4)
CURLM_INTERNAL_ERROR (4)
This can only be returned if libcurl bugs. Please report it to us!
i suggest that instead of our current
while (curl_multi_exec($this->handle, $runningCount) === CURLM_CALL_MULTI_PERFORM);
approach, we do something like
do{
$err = curl_multi_exec($this->handle, $runningCount);
} while($err === CURLM_CALL_MULTI_PERFORM);
if($err !== CURLM_OK){
throw new \RuntimeException(...)
}
also error info can be obtained by doing something like:
$errinfo = [
"multi_exec_return" => $err,
"curl_multi_errno" => curl_multi_errno($mh),
"curl_multi_strerror" => curl_multi_strerror($err)
];
Could you please give a hint how can I add pause before making each request?
I don't want all of my requests in queue start simultaneously, but rather one after another, for example every 1 second.
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.