X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=tests%2Fflush001.phpt;fp=tests%2Fflush001.phpt;h=c5a40e3ebd0c9af323ba04811722bc00c12efab4;hp=0000000000000000000000000000000000000000;hb=a3df086cd5d06891864ccf57acf81cea22e79f8b;hpb=e4075e6d5c7497fd44463f2fe985dee7a54c1bee diff --git a/tests/flush001.phpt b/tests/flush001.phpt new file mode 100644 index 0000000..c5a40e3 --- /dev/null +++ b/tests/flush001.phpt @@ -0,0 +1,44 @@ +--TEST-- +flush +--SKIPIF-- + +--FILE-- +nonblocking = true; +var_dump($c->nonblocking); +$c->execAsync("SELECT '".str_repeat("a", 6e7)."'", function($r) { + $r->fetchCol($s); + var_dump(strlen($s)); +}); +var_dump($flushed = $c->flush()); +do { + while (!$flushed || $c->busy) { + $r = $c->busy ? [$c->socket] : null; + $w = !$flushed ?[$c->socket] : null; + + if (stream_select($r, $w, $e, null)) { + if ($r) { + printf("P%d", $c->poll()); + } + if ($w) { + printf("F%d", $flushed = $c->flush()); + } + } + } + echo "\n"; +} while ($c->getResult()); +?> +===DONE=== +--EXPECTF-- +Test +bool(true) +bool(%s) +%r(F0)*(F1)*(P3)+%r +int(60000000) + +===DONE===