stream_set_blocking($file, false);
$this->ticker->read($file, function ($file) use (&$r) {
- return $r;
+ fread($file, fstat($file)["size"]);
});
$this->assertCount(1, $this->ticker);
$this->ticker->write($file, function ($file) use (&$w) {
$this->assertCount(2, $this->ticker);
$this->assertSame(2, $this->ticker->wait());
- $r = true;
- $this->assertSame(1, $this->ticker->wait());
- $w = true;
$this->assertSame(0, $this->ticker->wait());
}