Class BatchRequestTransfer
Batch transfer strategy used to efficiently transfer a batch of requests.
This class is to be used with Guzzle\Batch\BatchInterface
- Guzzle\Batch\BatchRequestTransfer implements Guzzle\Batch\BatchTransferInterface, Guzzle\Batch\BatchDivisorInterface
Methods summary
-
public
__construct ( int $batchSize = 50 )
Constructor used to specify how large each batch should be
-
public
createBatches ( SplQueue $queue )
Creates batches of requests by grouping requests by their associated curl multi object. Divide a queue of items into an array batches
-
public
transfer ( array $batch )
Transfer an array of items
Methods detail
Constructor used to specify how large each batch should be
Parameters
- $batchSize
integer
$batchSize Size of each batch
Creates batches of requests by grouping requests by their associated curl multi object. Divide a queue of items into an array batches
Parameters
- $queue
SplQueue
$queue Queue of items to divide into batches. Items are removed as they are iterated.
Returns
Implementation of
Transfer an array of items
Parameters
- $batch
array
$batch Array of items to transfer
Implementation of
Magic methods summary
Properties summary
protected
integer
|
$batchSize |
#
Size of each command batch |