Request Pooling
pecl_http also inherits cURL’s support for request pooling, or sending and processing multiple requests in parallel. Like other features, pecl_http implements it in a more succinct fashion. Oddly enough, it is one feature that is limited to pecl_http’s object-oriented API and has no equivalent in its procedural API. It is implemented in the form of the HttpRequestPool class. <?php $request1 = new HttpRequest; // configure $request1 $request2 = new HttpRequest; // configure $request2 $request3 = new HttpRequest; // configure $request3 $pool = new HttpRequestPool($request1, $request2); $pool->attach($request3); $pool->send(); ?>
© pecl_http PECL Extension — Web Scraping >>> Back to TABLE OF CONTENTS <<< | |
Views: 398 | |
Total comments: 0 | |