Documentation

BatchBuilder
in package

Builder used to create custom batch objects

Table of Contents

Properties

$afterFlush  : mixed
$autoFlush  : bool
$divisorStrategy  : BatchDivisorInterface
$exceptionBuffering  : bool
$history  : bool
$mapping  : array<string|int, mixed>
$transferStrategy  : BatchTransferInterface

Methods

autoFlushAt()  : BatchBuilder
Automatically flush the batch when the size of the queue reaches a certain threshold. Adds {@see FlushingBatch}.
bufferExceptions()  : 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.
build()  : BatchInterface
Create and return the instantiated batch
createBatchesWith()  : BatchBuilder
Specify the strategy used to divide the queue into an array of batches
factory()  : BatchBuilder
Create a new instance of the BatchBuilder
keepHistory()  : BatchBuilder
Maintain a history of all items that have been transferred using the batch. Adds {@see HistoryBatch}.
notify()  : BatchBuilder
Notify a callable each time a batch flush completes. Enables the {@see NotifyingBatch} decorator.
transferCommands()  : BatchBuilder
Configures the batch to transfer batches commands. Associates as {@see \Guzzle\Service\Command\BatchCommandTransfer} as both the transfer and divisor strategy.
transferRequests()  : BatchBuilder
Configures the batch to transfer batches of requests. Associates a {@see \Guzzle\Http\BatchRequestTransfer} object as both the transfer and divisor strategy.
transferWith()  : BatchBuilder
Specify the strategy used to transport the items when flush is called

Properties

$afterFlush

protected mixed $afterFlush

Callable to invoke each time a flush completes

$autoFlush

protected bool $autoFlush = false

Whether or not the batch should automatically flush

$exceptionBuffering

protected bool $exceptionBuffering = false

Whether or not to buffer exceptions encountered in transfer

$history

protected bool $history = false

Whether or not to maintain a batch history

$mapping

protected static array<string|int, mixed> $mapping = array('request' => 'Guzzle\Batch\BatchRequestTransfer', 'command' => 'Guzzle\Batch\BatchCommandTransfer')

of Mapped transfer strategies by handle name

Methods

autoFlushAt()

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

public autoFlushAt(mixed $threshold) : BatchBuilder
Parameters
$threshold : mixed

Number of items to allow in the queue before a flush

Return values
BatchBuilder

bufferExceptions()

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.

public bufferExceptions() : BatchBuilder
Return values
BatchBuilder

keepHistory()

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

public keepHistory() : BatchBuilder
Return values
BatchBuilder

notify()

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

public notify(mixed $callable) : BatchBuilder
Parameters
$callable : mixed

Callable function to notify

Tags
throws
InvalidArgumentException

if the argument is not callable

Return values
BatchBuilder

transferCommands()

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

public transferCommands([int $batchSize = 50 ]) : BatchBuilder
Parameters
$batchSize : int = 50

Batch size for each batch of commands

Return values
BatchBuilder

transferRequests()

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

public transferRequests([int $batchSize = 50 ]) : BatchBuilder
Parameters
$batchSize : int = 50

Batch size for each batch of requests

Return values
BatchBuilder

        
On this page

Search results