NOTE: For Version 3 of the AWS SDK for PHP, please see the V3 User Guide and V3 API Reference.

# Class FlushingBatch

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

  Guzzle\Batch\AbstractBatchDecorator implements Guzzle\Batch\BatchInterface
  Guzzle\Batch\FlushingBatch

Namespace: Guzzle\Batch
Located at Guzzle/Batch/FlushingBatch.php

## Methods summary

- `public` `__construct ( Guzzle\Batch\BatchInterface $decoratedBatch, int $threshold )`
- `public` `setThreshold ( int $threshold )`

  Set the auto-flush threshold

- `public` `getThreshold ( )`

  Get the auto-flush threshold

- `public` `add ( mixed $item )`

  Add an item to the queue

## Methods detail

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

#### Parameters

$decoratedBatch
  ``Guzzle\Batch\BatchInterface``
  $decoratedBatch BatchInterface that is being decorated
$threshold
  `integer`
  $threshold Flush when the number in queue matches the threshold

#### Overrides

`Guzzle\Batch\AbstractBatchDecorator::__construct`
# `public `Guzzle\Batch\FlushingBatch``
`setThreshold( integer $threshold )`

Set the auto-flush threshold

#### Parameters

$threshold
  `integer`
  $threshold The auto-flush threshold

#### Returns

``Guzzle\Batch\FlushingBatch``
# `public integer`
`getThreshold( )`

Get the auto-flush threshold

#### Returns

`integer`
# `public `Guzzle\Batch\FlushingBatch``
`add( mixed $item )`

Add an item to the queue

#### Parameters

$item
  `mixed`
  $item Item to add

#### Returns

``Guzzle\Batch\FlushingBatch``

#### Overrides

`Guzzle\Batch\AbstractBatchDecorator::add`

### Methods inherited from Guzzle\Batch\AbstractBatchDecorator

`__call()`, `flush()`, `getDecorators()`, `isEmpty()`

### Magic methods summary

## Properties summary

`protected integer` | $threshold | # The threshold for which to automatically flush
`protected integer` | $currentTotal | # Current number of items known to be in the queue

### Properties inherited from Guzzle\Batch\AbstractBatchDecorator

`$decoratedBatch`