Open Journal Systems  3.3.0
Guzzle\Batch\BatchBuilder Class Reference

Public Member Functions

 autoFlushAt ($threshold)
 
 bufferExceptions ()
 
 build ()
 
 createBatchesWith (BatchDivisorInterface $divisorStrategy)
 
 keepHistory ()
 
 notify ($callable)
 
 transferCommands ($batchSize=50)
 
 transferRequests ($batchSize=50)
 
 transferWith (BatchTransferInterface $transferStrategy)
 

Static Public Member Functions

static factory ()
 

Protected Attributes

 $afterFlush
 
 $autoFlush = false
 
 $divisorStrategy
 
 $exceptionBuffering = false
 
 $history = false
 
 $transferStrategy
 

Static Protected Attributes

static $mapping
 

Detailed Description

Builder used to create custom batch objects

Definition at line 11 of file BatchBuilder.php.

Member Function Documentation

◆ autoFlushAt()

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

Automatically flush the batch when the size of the queue reaches a certain threshold. Adds {

See also
FlushingBatch}.
Parameters
$thresholdNumber of items to allow in the queue before a flush
Returns
BatchBuilder

Definition at line 72 of file BatchBuilder.php.

◆ bufferExceptions()

Guzzle\Batch\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 also
ExceptionBufferingBatch} decorator.
Returns
BatchBuilder

Definition at line 97 of file BatchBuilder.php.

◆ build()

Guzzle\Batch\BatchBuilder::build ( )

Create and return the instantiated batch

Returns
BatchInterface
Exceptions
RuntimeExceptionif no transfer strategy has been specified

Definition at line 187 of file BatchBuilder.php.

◆ createBatchesWith()

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

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

Parameters
BatchDivisorInterface$divisorStrategyStrategy used to divide a batch queue into batches
Returns
BatchBuilder

Definition at line 160 of file BatchBuilder.php.

References Guzzle\Batch\BatchBuilder\$divisorStrategy.

◆ factory()

◆ keepHistory()

Guzzle\Batch\BatchBuilder::keepHistory ( )

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

See also
HistoryBatch}.
Returns
BatchBuilder

Definition at line 84 of file BatchBuilder.php.

◆ notify()

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

Notify a callable each time a batch flush completes. Enables the {

See also
NotifyingBatch} decorator.
Parameters
mixed$callableCallable function to notify
Returns
BatchBuilder
Exceptions
InvalidArgumentExceptionif the argument is not callable

Definition at line 112 of file BatchBuilder.php.

◆ transferCommands()

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

Configures the batch to transfer batches commands. Associates as {

See also
\Guzzle\Service\Command\BatchCommandTransfer} as both the transfer and divisor strategy.
Parameters
int$batchSizeBatch size for each batch of commands
Returns
BatchBuilder

Definition at line 144 of file BatchBuilder.php.

References Guzzle\Batch\BatchBuilder\$transferStrategy.

◆ transferRequests()

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

Configures the batch to transfer batches of requests. Associates a {

See also
\Guzzle\Http\BatchRequestTransfer} object as both the transfer and divisor strategy.
Parameters
int$batchSizeBatch size for each batch of requests
Returns
BatchBuilder

Definition at line 127 of file BatchBuilder.php.

References Guzzle\Batch\BatchBuilder\$transferStrategy.

◆ transferWith()

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

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

Parameters
BatchTransferInterface$transferStrategyHow items are transferred
Returns
BatchBuilder

Definition at line 174 of file BatchBuilder.php.

References Guzzle\Batch\BatchBuilder\$transferStrategy.

Field Documentation

◆ $afterFlush

mixed Guzzle\Batch\BatchBuilder::$afterFlush
protected

Callable to invoke each time a flush completes

Definition at line 35 of file BatchBuilder.php.

◆ $autoFlush

bool Guzzle\Batch\BatchBuilder::$autoFlush = false
protected

Whether or not the batch should automatically flush

Definition at line 17 of file BatchBuilder.php.

◆ $divisorStrategy

BatchDivisorInterface Guzzle\Batch\BatchBuilder::$divisorStrategy
protected

Object used to divide the queue into batches

Definition at line 47 of file BatchBuilder.php.

Referenced by Guzzle\Batch\BatchBuilder\createBatchesWith().

◆ $exceptionBuffering

bool Guzzle\Batch\BatchBuilder::$exceptionBuffering = false
protected

Whether or not to buffer exceptions encountered in transfer

Definition at line 29 of file BatchBuilder.php.

◆ $history

bool Guzzle\Batch\BatchBuilder::$history = false
protected

Whether or not to maintain a batch history

Definition at line 23 of file BatchBuilder.php.

◆ $mapping

Guzzle\Batch\BatchBuilder::$mapping
staticprotected
Initial value:
= array(
'request' => 'Guzzle\Batch\BatchRequestTransfer',
'command' => 'Guzzle\Batch\BatchCommandTransfer'
)

Definition at line 50 of file BatchBuilder.php.

◆ $transferStrategy

BatchTransferInterface Guzzle\Batch\BatchBuilder::$transferStrategy
protected

Object used to transfer items in the queue

Definition at line 41 of file BatchBuilder.php.

Referenced by Guzzle\Batch\BatchBuilder\transferCommands(), Guzzle\Batch\BatchBuilder\transferRequests(), and Guzzle\Batch\BatchBuilder\transferWith().


The documentation for this class was generated from the following file: