From: Michael Wallner Date: Wed, 15 Jun 2005 13:03:44 +0000 (+0000) Subject: - update docs X-Git-Tag: RELEASE_0_9_0~5 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=624d6e2d2b7449fcbc736a1536521261704f7da7;p=m6w6%2Fext-http - update docs --- diff --git a/docs/functions.html b/docs/functions.html index a1f9024..92a14ca 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -492,8 +492,41 @@ GET example:




+

HttpRequestPool

+

void HttpRequestPool::__construct()

+

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


+<?php
    $urls
= array('www.php.net', 'pecl.php.net', 'pear.php.net')
    
$pool = new HttpRequestPool;
    foreach (
$urls as $url) {
        
$req[$url] = new HttpRequest("http://$url", HTTP_HEAD);
        
$pool->attach($req[$url]);
    }
    
$pool->send();
    foreach (
$urls as $url) {
        
printf("%s (%s) is %s\n",
            
$url, $req[$url]->getResponseInfo('effective_url'),
            
$r->getResponseCode() == 200 ? 'alive' : 'not alive'
        
);
    }
?>
+

+

+
+

+

void HttpRequestPool::__destruct()

+

Clean up HttpRequestPool object.

+

void HttpRequestPool::reset()

+

Detach all attached HttpRequest objects.

+

bool HttpRequestPool::attach(HttpRequest request)

+

Attach an HttpRequest object to this HttpRequestPool.
+NOTE: set all options prior attaching!

+

bool HttpRequestPool::detach(HttpRequest request)

+

Detach an HttpRequest object from this HttpRequestPool.

+

bool HttpRequestPool::send()

+

Send all attached HttpRequest objects in parallel.

+

protected bool HttpRequestPool::socketSend()

+

Usage:


+<?php
    
while ($pool->socketSend()) {
        
do_something_else();
        if (!
$pool->socketSelect()) {
            die(
'Socket error');
        }
    }
    
$pool->socketRead();
?>
+

+

+
+

+

protected bool HttpRequestPool::socketSelect()

+

See HttpRequestPool::socketSend().

+

protected void HttpRequestPool::socketRead()

+

See HttpRequestPool::socketSend().


-

Generated at: Mon, 6 Jun 2005 13:44:11 +0200

+

Generated at: Tue, 14 Jun 2005 16:56:52 +0200