From 8df3db566a3a937b45ebf11adb90d265e6f5e2d4 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 17 Nov 2019 20:45:02 +0100 Subject: initial checking of customized version 1.0rc9 --- .../guzzle/src/Guzzle/Batch/FlushingBatch.php | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 vendor/guzzle/guzzle/src/Guzzle/Batch/FlushingBatch.php (limited to 'vendor/guzzle/guzzle/src/Guzzle/Batch/FlushingBatch.php') diff --git a/vendor/guzzle/guzzle/src/Guzzle/Batch/FlushingBatch.php b/vendor/guzzle/guzzle/src/Guzzle/Batch/FlushingBatch.php new file mode 100644 index 0000000..367b684 --- /dev/null +++ b/vendor/guzzle/guzzle/src/Guzzle/Batch/FlushingBatch.php @@ -0,0 +1,60 @@ +threshold = $threshold; + parent::__construct($decoratedBatch); + } + + /** + * Set the auto-flush threshold + * + * @param int $threshold The auto-flush threshold + * + * @return FlushingBatch + */ + public function setThreshold($threshold) + { + $this->threshold = $threshold; + + return $this; + } + + /** + * Get the auto-flush threshold + * + * @return int + */ + public function getThreshold() + { + return $this->threshold; + } + + public function add($item) + { + $this->decoratedBatch->add($item); + if (++$this->currentTotal >= $this->threshold) { + $this->currentTotal = 0; + $this->decoratedBatch->flush(); + } + + return $this; + } +} -- cgit v1.2.3-54-g00ecf