Coder Social home page Coder Social logo

async-request's People

Contributors

martinmajor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

async-request's Issues

php versions < 7

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?

we're (mostly) ignoring the return of curl_multi_exec()

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)
                ];

pause between requests

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.