protected function readAllChunkedGenHandler($cb, $chunkcb, $size, &$offset, $pri)
    {
        return function ($file, $data) use ($cb, $chunkcb, $size, &$offset, $pri) {
            $chunkcb($file, $data);
            $offset += mb_orig_strlen($data);
            $len = min($file->chunkSize, $size - $offset);

            if ($offset >= $size) {
                $cb($file, true);
                return;
            }

            eio_read(
                $file->fd,
                $len,
                $offset,
                $pri,
                $this->readAllChunkedGenHandler($cb, $chunkcb, $size, $offset, $pri),
                $file
            );
        };
    }
protected function readAllChunkedGenHandler($cb, $chunkcb, $size, &$offset, $pri)
    {
        return function ($file, $data) use ($cb, $chunkcb, $size, &$offset, $pri) {
            $chunkcb($file, $data);
            $offset += mb_orig_strlen($data);
            $len = min($file->chunkSize, $size - $offset);

            if ($offset >= $size) {
                $cb($file, true);
                return;
            }

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