2017 © Pedro Peláez
 

library flusher

Endroid Flusher

image

endroid/flusher

Endroid Flusher

  • Monday, April 16, 2018
  • by endroid
  • Repository
  • 1 Watchers
  • 6 Stars
  • 1,544 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 12 Versions
  • 6 % Grown

The README.md

Flusher

By endroid, (*1)

Latest Stable Version Build Status Total Downloads Monthly Downloads License, (*2)

When you import or modify large amounts of data it is often necessary to define the optimal batch size before flushing: small batch sizes perform bad because of the overhead in each flush. And batch sizes that are too large perform bad because of the high memory usage and the need to calculate a large change set. Also the batch size you choose can give different results on different types of hardware., (*3)

This library helps you write entities to the database without worrying about the batch size. It incrementally tries new batch sizes (given a step size), sticks with the one that gives the highest performance or switches to a better batch size if the circumstances have changed., (*4)

Installation

Use Composer to install the library., (*5)

``` bash $ composer require endroid/flusher, (*6)


## Usage In order to enable auto flushing you first need to create a Flusher for the entity manager you are currently using. ```php $flusher = new Flusher($manager);

Then when you performed operations on your entity manager you can call the flush() method on the flusher any time to notify there are changes., (*7)

for ($n = 1; $n <= 50000; $n++) {
    $task = new Task();
    $task->setName('Task '.$n);
    $manager->persist($task);
    $flusher->flush();
}

Because there is no way of knowing if there are pending flushes at the end you need to call finish() to make sure all data is flushed., (*8)

$flusher->finish();

Versioning

Version numbers follow the MAJOR.MINOR.PATCH scheme. Backwards compatibility breaking changes will be kept to a minimum but be aware that these can occur. Lock your dependencies for production and test your code when upgrading., (*9)

License

This bundle is under the MIT license. For the full copyright and license information please view the LICENSE file that was distributed with this source code., (*10)

The Versions

16/04 2018

dev-master

9999999-dev https://github.com/endroid/flusher

Endroid Flusher

  Sources   Download

MIT

The Requires

 

The Development Requires

php bundle symfony endroid flusher

08/12 2017

2.0.1

2.0.1.0 https://github.com/endroid/Flusher

Endroid Flusher

  Sources   Download

MIT

The Requires

 

The Development Requires

endroid flusher

07/12 2017

2.0.0

2.0.0.0 https://github.com/endroid/Flusher

Endroid Flusher

  Sources   Download

MIT

The Requires

 

The Development Requires

endroid flusher

28/10 2017

1.x-dev

1.9999999.9999999.9999999-dev https://github.com/endroid/Flusher

Endroid Flusher

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid flusher

14/08 2017

1.0.7

1.0.7.0 https://github.com/endroid/Flusher

Endroid Flusher

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid flusher

09/08 2017

1.0.6

1.0.6.0 https://github.com/endroid/Flusher

Endroid Flusher

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid flusher

08/08 2017

1.0.5

1.0.5.0 https://github.com/endroid/Flusher

Endroid Flusher

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid flusher

08/08 2017

1.0.4

1.0.4.0 https://github.com/endroid/Flusher

Endroid Flusher

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid flusher

31/07 2017

1.0.3

1.0.3.0 https://github.com/endroid/Flusher

Endroid Flusher

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid flusher

27/07 2017

1.0.2

1.0.2.0 https://github.com/endroid/Flusher

Endroid Flusher

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid flusher

25/07 2017

1.0.1

1.0.1.0 https://github.com/endroid/Flusher

Endroid Flusher

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid flusher

25/07 2017

1.0.0

1.0.0.0 https://github.com/endroid/Flusher

Endroid Flusher

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle symfony endroid flusher