Reference documentation and code samples for the Google Cloud PHP shared dependency, providing functionality useful to all components. Client class BatchRunner.
A class for executing jobs in batch.
Namespace
Google \ Cloud \ Core \ BatchMethods
__construct
Determine internal implementation and loads the configuration.
configStorage
ConfigStorageInterface
[optional] The ConfigStorage object to use. Defaults tonull. This is only for testing purpose.
processor
ProcessItemInterface
[optional] The processor object to use. Defaults tonull. This is only for testing purpose.
registerJob
Register a job for batch execution.
identifier
string
Unique identifier of the job.
func
callable
Any Callable except for Closure. The callable should accept an array of items as the first argument.
options
array
Configuration options.
↳ batchSize
int
The size of the batch.
↳ callPeriod
float
The period in seconds from the last execution to force executing the job.
↳ numWorkers
↳ bootstrapFile
string
A file to load before executing the job. It's needed for registering global functions.
bool
submitItem
Submit an item.
identifier
string
Unique identifier of the job.
item
mixed
It needs to be serializable.
void
getJobFromId
Get the job with the given identifier.
identifier
string
Unique identifier of the job.
getJobFromIdNum
Get the job with the given numeric id.
idNum
int
A numeric id of the job.
getJobs
Get all the jobs.
loadConfig
Load the config from the storage.
bool
getProcessor
Gets the item processor.
ProcessItemInterface