Reference documentation and code samples for the Google Cloud PHP shared dependency, providing functionality useful to all components. Client class BatchJob.
Represent batch jobs.
Namespace
Google \ Cloud \ Core \ Batch
Methods
__construct
Parameters
Name
Description
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 to100.
↳ callPeriod
float
The period in seconds from the last execution to force executing the job.Defaults to2.0.
↳ numWorkers
int
The number of child processes. It only takes effect with theBatchDaemon.Defaults to1.
↳ 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.
Parameter
Name
Description
items
array
Returns
Type
Description
bool
callFunc
Finish any pending activity for this job.
Parameter
Name
Description
items
array
Returns
Type
Description
bool
getCallPeriod
Returns the period in seconds from the last execution to force
executing the job.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud PHP shared dependency, providing functionality useful to all components. Client - Class BatchJob (1.64.2)\n\nVersion latestkeyboard_arrow_down\n\n- [1.64.2 (latest)](/php/docs/reference/cloud-core/latest/Batch.BatchJob)\n- [1.64.1](/php/docs/reference/cloud-core/1.64.1/Batch.BatchJob)\n- [1.63.0](/php/docs/reference/cloud-core/1.63.0/Batch.BatchJob)\n- [1.62.3](/php/docs/reference/cloud-core/1.62.3/Batch.BatchJob)\n- [1.61.0](/php/docs/reference/cloud-core/1.61.0/Batch.BatchJob)\n- [1.60.1](/php/docs/reference/cloud-core/1.60.1/Batch.BatchJob)\n- [1.59.1](/php/docs/reference/cloud-core/1.59.1/Batch.BatchJob)\n- [1.58.2](/php/docs/reference/cloud-core/1.58.2/Batch.BatchJob)\n- [1.53.0](/php/docs/reference/cloud-core/1.53.0/Batch.BatchJob)\n- [1.52.11](/php/docs/reference/cloud-core/1.52.11/Batch.BatchJob)\n- [1.51.2](/php/docs/reference/cloud-core/1.51.2/Batch.BatchJob)\n- [1.50.0](/php/docs/reference/cloud-core/1.50.0/Batch.BatchJob)\n- [1.49.3](/php/docs/reference/cloud-core/1.49.3/Batch.BatchJob)\n- [1.48.1](/php/docs/reference/cloud-core/1.48.1/Batch.BatchJob) \n| **Beta**\n|\n|\n| This library is covered by the [Pre-GA Offerings Terms](/terms/service-terms#1)\n| of the Terms of Service. Pre-GA libraries might have limited support,\n| and changes to pre-GA libraries might not be compatible with other pre-GA versions.\n| For more information, see the\n[launch stage descriptions](/products#product-launch-stages). \nReference documentation and code samples for the Google Cloud PHP shared dependency, providing functionality useful to all components. Client class BatchJob.\n\nRepresent batch jobs.\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Core \\\\ Batch\n\nMethods\n-------\n\n### __construct\n\n### run\n\nRun the job.\n\n### flush\n\nFinish any pending activity for this job.\n\n### callFunc\n\nFinish any pending activity for this job.\n\n### getCallPeriod\n\nReturns the period in seconds from the last execution to force\nexecuting the job.\n\n### getBatchSize\n\nReturns the batch size.\n\nConstants\n---------\n\n### DEFAULT_BATCH_SIZE\n\n Value: 100\n\n### DEFAULT_CALL_PERIOD\n\n Value: 2.0\n\n### DEFAULT_WORKERS\n\n Value: 1"]]