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


README

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

Installation

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.

Example

$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
});

$batchProcessing->process();