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
$divisorStrategy
protected
BatchDivisorInterface
$divisorStrategy
Object used to divide the queue into batches
$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
$transferStrategy
protected
BatchTransferInterface
$transferStrategy
Object used to transfer items in the queue
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
BatchBuilderbufferExceptions()
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
BatchBuilderbuild()
Create and return the instantiated batch
public
build() : BatchInterface
Tags
Return values
BatchInterfacecreateBatchesWith()
Specify the strategy used to divide the queue into an array of batches
public
createBatchesWith(BatchDivisorInterface $divisorStrategy) : BatchBuilder
Parameters
- $divisorStrategy : BatchDivisorInterface
-
Strategy used to divide a batch queue into batches
Return values
BatchBuilderfactory()
Create a new instance of the BatchBuilder
public
static factory() : BatchBuilder
Return values
BatchBuilderkeepHistory()
Maintain a history of all items that have been transferred using the batch. Adds {@see HistoryBatch}.
public
keepHistory() : BatchBuilder
Return values
BatchBuildernotify()
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
Return values
BatchBuildertransferCommands()
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
BatchBuildertransferRequests()
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
BatchBuildertransferWith()
Specify the strategy used to transport the items when flush is called
public
transferWith(BatchTransferInterface $transferStrategy) : BatchBuilder
Parameters
- $transferStrategy : BatchTransferInterface
-
How items are transferred