Open Journal Systems  3.3.0
Guzzle\Batch\FlushingBatch Class Reference
Inheritance diagram for Guzzle\Batch\FlushingBatch:
Guzzle\Batch\AbstractBatchDecorator Guzzle\Batch\BatchInterface

Public Member Functions

 __construct (BatchInterface $decoratedBatch, $threshold)
 
 add ($item)
 
 getThreshold ()
 
 setThreshold ($threshold)
 
- Public Member Functions inherited from Guzzle\Batch\AbstractBatchDecorator
 __call ($method, array $args)
 
 __construct (BatchInterface $decoratedBatch)
 
 flush ()
 
 getDecorators ()
 
 isEmpty ()
 

Protected Attributes

 $currentTotal = 0
 
 $threshold
 
- Protected Attributes inherited from Guzzle\Batch\AbstractBatchDecorator
 $decoratedBatch
 

Detailed Description

BatchInterface decorator used to add automatic flushing of the queue when the size of the queue reaches a threshold.

Definition at line 8 of file FlushingBatch.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Batch\FlushingBatch::__construct ( BatchInterface  $decoratedBatch,
  $threshold 
)
Parameters
BatchInterface$decoratedBatchBatchInterface that is being decorated
int$thresholdFlush when the number in queue matches the threshold

Definition at line 26 of file FlushingBatch.php.

References Guzzle\Batch\AbstractBatchDecorator\$decoratedBatch, and Guzzle\Batch\FlushingBatch\$threshold.

Member Function Documentation

◆ add()

Guzzle\Batch\FlushingBatch::add (   $item)

Add an item to the queue

Parameters
mixed$itemItem to add
Returns
self

Reimplemented from Guzzle\Batch\AbstractBatchDecorator.

Definition at line 56 of file FlushingBatch.php.

◆ getThreshold()

Guzzle\Batch\FlushingBatch::getThreshold ( )

Get the auto-flush threshold

Returns
int

Definition at line 51 of file FlushingBatch.php.

References Guzzle\Batch\FlushingBatch\$threshold.

◆ setThreshold()

Guzzle\Batch\FlushingBatch::setThreshold (   $threshold)

Set the auto-flush threshold

Parameters
int$thresholdThe auto-flush threshold
Returns
FlushingBatch

Definition at line 39 of file FlushingBatch.php.

References Guzzle\Batch\FlushingBatch\$threshold.

Field Documentation

◆ $currentTotal

int Guzzle\Batch\FlushingBatch::$currentTotal = 0
protected

Current number of items known to be in the queue

Definition at line 20 of file FlushingBatch.php.

◆ $threshold

int Guzzle\Batch\FlushingBatch::$threshold
protected

The threshold for which to automatically flush

Definition at line 14 of file FlushingBatch.php.

Referenced by Guzzle\Batch\FlushingBatch\__construct(), Guzzle\Batch\FlushingBatch\getThreshold(), and Guzzle\Batch\FlushingBatch\setThreshold().


The documentation for this class was generated from the following file: