Giter Site home page Giter Site logo

Comments (3)

simp-lee avatar simp-lee commented on May 20, 2024 1

Thank you very much for your help.

Regarding the first question, your examples are written very clearly and are highly applicable. Well done!

As for the second question, I overcomplicated things, and you are right - simply removing the stop() call will do.

Thank you again for your assistance.
It's a fantastic class.

from php-curl-class.

zachborboa avatar zachborboa commented on May 20, 2024

Hi. For question 1, I've added an example:
https://github.com/php-curl-class/php-curl-class/blob/master/examples/multi_curl_track_success_urls.php

from php-curl-class.

zachborboa avatar zachborboa commented on May 20, 2024

For question 2, calling Curl::stop() inside the success callback can be removed.

Without removing the stop() call as in the example, the addGet() requests inside the success callback are queued, but the call to stop() immediately attempts to stop queued requests and active requests.

With the Curl::stop() inside the success callback removed:

$response = [];
$multi_curl ->success(function ($instance) use (&$response, $multi_curl){
    $multi_curl->addGet('pending_url_1');
    $multi_curl->addGet('pending_url_2');
    // more urls to be executed...
});

$multi_curl->addGet('url_1_need_to_be_executed');
$multi_curl->addGet('url_2_need_to_be_executed');
$multi_curl->addGet('url_3_need_to_be_executed');

$multi_curl->start();

from php-curl-class.

Related Issues (20)

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.