downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<HttpRequestPool::attachHttpRequestPool::__destruct>
Last updated: Thu, 26 Jun 2008

HttpRequestPool::__construct

(PECL pecl_http:0.10.0-1.5.5)

HttpRequestPool::__construct — HttpRequestPool constructor

Description

void HttpRequestPool::__construct ([ HttpRequest $request ] )

Instantiate a new HttpRequestPool object. An HttpRequestPool is able to send several HttpRequests in parallel.

Accepts virtually infinite optional parameters each referencing an HttpRequest object.

Parameters

request

HttpRequest object to attach

Errors/Exceptions

Throws HttpRequestPoolException (HttpRequestException, HttpInvalidParamException).

Examples

Example #1 A HttpRequestPool example

<?php
try
{
  
$pool = new HttpRequestPool(
       new
HttpRequest('http://www.google.com/', HttpRequest::METH_HEAD),
       new
HttpRequest('http://www.php.net/', HttpRequest::METH_HEAD)
   );
  
$pool->send();
   foreach(
$pool as $request) {
      
printf("%s is %s (%d)\n",
          
$request->getUrl(),
          
$request->getResponseCode() ? 'alive' : 'not alive',
          
$request->getResponseCode()
       );
   }
}
catch (HttpException $e) {
   echo
$e;
}
?>



add a noteadd a note User Contributed Notes
HttpRequestPool constructor
There are no user contributed notes for this page.




<HttpRequestPool::attachHttpRequestPool::__destruct>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs