2 HttpRequestPool detaching in callbacks
6 checkcls("HttpRequestPool");
7 checkurl("at.php.net");
8 checkurl("de.php.net");
13 class r extends HttpRequest {
14 function onProgress() {
16 if (empty($i[$this->getUrl()])) {
17 $i[$this->getUrl()] = true;
19 $GLOBALS['p']->detach($this);
20 } catch (Exception $ex) {
26 $GLOBALS['p']->detach($this);
29 $p = new HttpRequestPool(new r("http://at.php.net"), new r("http://de.php.net"));
31 var_dump($p->getAttachedRequests());
36 exception 'HttpRequestPoolException' with message 'HttpRequest object(#%d) cannot be detached from the HttpRequestPool while executing the progress callback' in %aHttpRequestPool_006.php:%d
38 #0 %aHttpRequestPool_006.php(%d): HttpRequestPool->detach(Object(r))
39 #1 [internal function]: r->onProgress(Array)
40 #2 %aHttpRequestPool_006.php(%d): HttpRequestPool->send()
42 exception 'HttpRequestPoolException' with message 'HttpRequest object(#%d) cannot be detached from the HttpRequestPool while executing the progress callback' in %aHttpRequestPool_006.php:%d
44 #0 %aHttpRequestPool_006.php(%d): HttpRequestPool->detach(Object(r))
45 #1 [internal function]: r->onProgress(Array)
46 #2 %aHttpRequestPool_006.php(%d): HttpRequestPool->send()