SymfonyBundles Patterns Library

v1.2.0 2019-04-17 20:05 UTC

This package is auto-updated.

Last update: 2020-11-17 23:42:38 UTC


Build Status Scrutinizer Code Quality Code Coverage Total Downloads Latest Stable Version License


Require the bundle with composer:

composer require symfony-bundles/patterns

Batch Processing Pattern

Calls listeners when the size of the package reaches the desired size.


$collection = (new \MongoDB\Client())->test->users;

$batchProcessing = new BatchProcessing(100, $collection->find());

$batchProcessing->addListener(function(array $elements) {
    // do something with the elements of the package