\Guzzle\BatchFlushingBatch

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

Summary

Methods
Properties
Constants
__construct()
__call()
add()
flush()
isEmpty()
getDecorators()
setThreshold()
getThreshold()
No public properties found
No constants found
No protected methods found
$decoratedBatch
$threshold
$currentTotal
N/A
No private methods found
No private properties found
N/A

Properties

$threshold

$threshold : integer

Type

integer — The threshold for which to automatically flush

$currentTotal

$currentTotal : integer

Type

integer — Current number of items known to be in the queue

Methods

__construct()

__construct(\Guzzle\Batch\BatchInterface  $decoratedBatch, integer  $threshold) 

Parameters

\Guzzle\Batch\BatchInterface $decoratedBatch

BatchInterface that is being decorated

integer $threshold

Flush when the number in queue matches the threshold

__call()

__call(string  $method, array  $args) : mixed

Allow decorators to implement custom methods

Parameters

string $method

Missing method name

array $args

Method arguments

Returns

mixed

add()

add(mixed  $item) : self

Add an item to the queue

Parameters

mixed $item

Item to add

Returns

self

flush()

flush() : array

Flush the batch and transfer the items

Returns

array —

Returns an array flushed items

isEmpty()

isEmpty() : boolean

Check if the batch is empty and has further items to transfer

Returns

boolean

getDecorators()

getDecorators() : array

Trace the decorators associated with the batch

Returns

array

setThreshold()

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

Set the auto-flush threshold

Parameters

integer $threshold

The auto-flush threshold

Returns

\Guzzle\Batch\FlushingBatch

getThreshold()

getThreshold() : integer

Get the auto-flush threshold

Returns

integer