protected function readAllGenHandler($cb, $size, &$offset, &$pri, &$buf)
    {
        return function ($file, $data) use ($cb, $size, &$offset, &$pri, &$buf) {
            $buf .= $data;
            $offset += mb_orig_strlen($data);
            $len = min($file->chunkSize, $size - $offset);
            if ($offset >= $size) {
                if ($cb) {
                    $cb($file, $buf);
                }
                return;
            }
            eio_read($file->fd, $len, $offset, $pri, $this->readAllGenHandler($cb, $size, $offset, $pri, $buf), $this);
        };
    }
protected function readAllGenHandler($cb, $size, &$offset, &$pri, &$buf)
    {
        return function ($file, $data) use ($cb, $size, &$offset, &$pri, &$buf) {
            $buf .= $data;
            $offset += mb_orig_strlen($data);
            $len = min($file->chunkSize, $size - $offset);
            if ($offset >= $size) {
                if ($cb) {
                    $cb($file, $buf);
                }
                return;
            }
            eio_read($file->fd, $len, $offset, $pri, $this->readAllGenHandler($cb, $size, $offset, $pri, $buf), $this);
        };
    }
protected function readAllGenHandler ( $ cb , $ size , & $ offset , & $ pri , & $ buf ) { return function ( $ file , $ data ) use ( $ cb , $ size , & $ offset , & $ pri , & $ buf ) { $ buf .= $ data ; $ offset += mb_orig_strlen ( $ data ) ; $ len = min ( $ file -> chunkSize , $ size - $ offset ) ; if ( $ offset >= $ size ) { if ( $ cb ) { $ cb ( $ file , $ buf ) ; } return ; } eio_read ( $ file -> fd , $ len , $ offset , $ pri , $ this -> readAllGenHandler ( $ cb , $ size , $ offset , $ pri , $ buf ) , $ this ) ; } ; }
Generates closure-callback for readAll
@param  callable $cb
@param  integer $size
@param  integer &$offset
@param  integer &$pri
@param  string &$buf
@return callable
Generates closure - callback for readAll