\Guzzle\BatchBatchBuilder

Builder used to create custom batch objects

Summary

Methods
Properties
Constants
factory()
autoFlushAt()
keepHistory()
bufferExceptions()
notify()
transferRequests()
transferCommands()
createBatchesWith()
transferWith()
build()
No public properties found
No constants found
No protected methods found
$autoFlush
$history
$exceptionBuffering
$afterFlush
$transferStrategy
$divisorStrategy
$mapping
N/A
No private methods found
No private properties found
N/A

Properties

$autoFlush

$autoFlush : boolean

Type

boolean — Whether or not the batch should automatically flush

$history

$history : boolean

Type

boolean — Whether or not to maintain a batch history

$exceptionBuffering

$exceptionBuffering : boolean

Type

boolean — Whether or not to buffer exceptions encountered in transfer

$afterFlush

$afterFlush : mixed

Type

mixed — Callable to invoke each time a flush completes

$mapping

$mapping : array

Type

array — of Mapped transfer strategies by handle name

Methods

autoFlushAt()

autoFlushAt(  $threshold) : \Guzzle\Batch\BatchBuilder

Automatically flush the batch when the size of the queue reaches a certain threshold. Adds {@see FlushingBatch}.

Parameters

$threshold

Number of items to allow in the queue before a flush

Returns

\Guzzle\Batch\BatchBuilder

keepHistory()

keepHistory() : \Guzzle\Batch\BatchBuilder

Maintain a history of all items that have been transferred using the batch. Adds {@see HistoryBatch}.

Returns

\Guzzle\Batch\BatchBuilder

bufferExceptions()

bufferExceptions() : \Guzzle\Batch\BatchBuilder

Buffer exceptions thrown during transfer so that you can transfer as much as possible, and after a transfer completes, inspect each exception that was thrown. Enables the {@see ExceptionBufferingBatch} decorator.

Returns

\Guzzle\Batch\BatchBuilder

notify()

notify(mixed  $callable) : \Guzzle\Batch\BatchBuilder

Notify a callable each time a batch flush completes. Enables the {@see NotifyingBatch} decorator.

Parameters

mixed $callable

Callable function to notify

Throws

\Guzzle\Common\Exception\InvalidArgumentException

if the argument is not callable

Returns

\Guzzle\Batch\BatchBuilder

transferRequests()

transferRequests(integer  $batchSize = 50) : \Guzzle\Batch\BatchBuilder

Configures the batch to transfer batches of requests. Associates a {@see \Guzzle\Http\BatchRequestTransfer} object as both the transfer and divisor strategy.

Parameters

integer $batchSize

Batch size for each batch of requests

Returns

\Guzzle\Batch\BatchBuilder

transferCommands()

transferCommands(integer  $batchSize = 50) : \Guzzle\Batch\BatchBuilder

Configures the batch to transfer batches commands. Associates as {@see \Guzzle\Service\Command\BatchCommandTransfer} as both the transfer and divisor strategy.

Parameters

integer $batchSize

Batch size for each batch of commands

Returns

\Guzzle\Batch\BatchBuilder

createBatchesWith()

createBatchesWith(\Guzzle\Batch\BatchDivisorInterface  $divisorStrategy) : \Guzzle\Batch\BatchBuilder

Specify the strategy used to divide the queue into an array of batches

Parameters

\Guzzle\Batch\BatchDivisorInterface $divisorStrategy

Strategy used to divide a batch queue into batches

Returns

\Guzzle\Batch\BatchBuilder

transferWith()

transferWith(\Guzzle\Batch\BatchTransferInterface  $transferStrategy) : \Guzzle\Batch\BatchBuilder

Specify the strategy used to transport the items when flush is called

Parameters

\Guzzle\Batch\BatchTransferInterface $transferStrategy

How items are transferred

Returns

\Guzzle\Batch\BatchBuilder

build()

build() : \Guzzle\Batch\BatchInterface

Create and return the instantiated batch

Throws

\Guzzle\Common\Exception\RuntimeException

if no transfer strategy has been specified

Returns

\Guzzle\Batch\BatchInterface