X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=docs%2Fexamples%2FParallel_Requests.php;fp=docs%2Fexamples%2FParallel_Requests.php;h=962ea0527463a72457416f27c0fb1875edc1a0ec;hp=0000000000000000000000000000000000000000;hb=b562e34cf4f8c8fae7b8fe773e0eed71592b09c2;hpb=b1d7d87f91b5cdcf321cb103e1a315f639885d61 diff --git a/docs/examples/Parallel_Requests.php b/docs/examples/Parallel_Requests.php new file mode 100644 index 0000000..962ea05 --- /dev/null +++ b/docs/examples/Parallel_Requests.php @@ -0,0 +1,22 @@ +attach(new HttpRequest('http://pear.php.net', HTTP_HEAD)); + $p->attach(new HttpRequest('http://pecl.php.net', HTTP_HEAD)); +} catch (HttpException $e) { + print $e; + exit; +} + +try { + $p->send(); + // HttpRequestPool implements an iterator over attached HttpRequest objects + foreach ($p as $r) { + print "Checking ", $r->getUrl(), " reported ", $r->getResponseCode(), "\n"; + } +} catch (HttpException $e) { + print $e; +} +?>