PHP Interface Spork\Batch\Strategy\StrategyInterface

See also: BatchJob::__invoke()
Datei anzeigen Open project: kriswallsmith/spork

Public Methods

Method Description
createBatches ( mixed $data ) : array | Traversable Creates an iterator for the supplied data.
createRunner ( mixed $batch, callable $callback ) : callable Creates a batch runner for the supplied list.

Method Details

createBatches() public method

Creates an iterator for the supplied data.
public createBatches ( mixed $data ) : array | Traversable
$data mixed The raw batch data
return array | Traversable An iterator of batches

createRunner() public method

A batch runner is a callable that is passed to ProcessManager::fork() that should run each item in the supplied batch through a callable.
public createRunner ( mixed $batch, callable $callback ) : callable
$batch mixed A batch of items
$callback callable The batch callback
return callable A callable for the child process