Reference documentation and code samples for the Google Cloud PHP shared dependency, providing functionality useful to all components. Client class BatchJob.
Represent batch jobs.
Methods
__construct
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.
idNum
int
A numeric id for the job.
options
array
Configuration options.
↳ batchSize
int
The size of the batch. Defaults to 100
.
↳ callPeriod
float
The period in seconds from the last execution to force executing the job. Defaults to 2.0
.
↳ numWorkers
int
The number of child processes. It only takes effect with the Google\Cloud\Core\Batch\BatchDaemon
. Defaults to 1
.
↳ bootstrapFile
string
A file to load before executing the job. It's needed for registering global functions.
run
Run the job.
flush
Finish any pending activity for this job.
items
array
bool
getCallPeriod
Returns the period in seconds from the last execution to force executing the job.
float
getBatchSize
Returns the batch size.
int
Constants
DEFAULT_BATCH_SIZE
Value: 100
DEFAULT_CALL_PERIOD
Value: 2.0
DEFAULT_WORKERS
Value: 1