X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=docs%2Fexamples%2FParallel_Requests_.php;h=8798c30f6b5680f92f85c3759bd7a65efc163882;hp=e1eb88f52c6f3f27c519954cd084e5f4122431ad;hb=229730a74c2686bdf501528cbe44a9421ccca61a;hpb=b562e34cf4f8c8fae7b8fe773e0eed71592b09c2 diff --git a/docs/examples/Parallel_Requests_.php b/docs/examples/Parallel_Requests_.php index e1eb88f..8798c30 100644 --- a/docs/examples/Parallel_Requests_.php +++ b/docs/examples/Parallel_Requests_.php @@ -4,8 +4,8 @@ class Pool extends HttpRequestPool public function __construct() { parent::__construct( - new HttpRequest('http://pear.php.net', HTTP_HEAD), - new HttpRequest('http://pecl.php.net', HTTP_HEAD) + new HttpRequest('http://pear.php.net', HTTP_METH_HEAD), + new HttpRequest('http://pecl.php.net', HTTP_METH_HEAD) ); // HttpRequestPool methods socketPerform() and socketSelect() are @@ -13,7 +13,7 @@ class Pool extends HttpRequestPool // while the requests are being executed print "Executing requests"; for ($i = 0; $this->socketPerform(); $i++) { - $i % 3 or print "."; + $i % 10 or print "."; if (!$this->socketSelect()) { throw new HttpException("Socket error!"); } @@ -24,7 +24,7 @@ class Pool extends HttpRequestPool try { foreach (new Pool as $r) { - print "Checking ", $r->getUrl(), " reported ", $r->getResponseCode(), "\n"; + echo "Checking ", $r->getUrl(), " reported ", $r->getResponseCode(), "\n"; } } catch (HttpException $ex) { print $e;