projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
- encodings support exists with ext/zlib too
[m6w6/ext-http]
/
docs
/
examples
/
Parallel_Requests_.php
diff --git
a/docs/examples/Parallel_Requests_.php
b/docs/examples/Parallel_Requests_.php
index e1eb88f52c6f3f27c519954cd084e5f4122431ad..8798c30f6b5680f92f85c3759bd7a65efc163882 100644
(file)
--- 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(
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
);
// 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++) {
// 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!");
}
if (!$this->socketSelect()) {
throw new HttpException("Socket error!");
}
@@
-24,7
+24,7
@@
class Pool extends HttpRequestPool
try {
foreach (new Pool as $r) {
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;
}
} catch (HttpException $ex) {
print $e;