PHP code example of vend / chunky

1. Go to this page and download the library: Download vend/chunky library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vend / chunky example snippets


use Chunky\Chunk;

$options = [];

$chunk = new Chunk(
    500,     // Initial chunk size
    0.2,     // Target wallclock execution time in seconds
    $options
);

for (/* ... */) {
    $size = $chunk->getEstimatedSize();

    $chunk->begin();
    // Process $size records
    $chunk->end();
}

use Chunky\ReplicatedChunk;

/* @var Doctrine\DBAL\Connection $conn */
/* @var Doctrine\DBAL\Connection $conn2 */

$chunk = new ReplicatedChunk(500, 0.2, $options);
$chunk->setSlaves([$conn, $conn2]);