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 \ Batch
Methods
__construct
Determine internal implementation and loads the configuration.
Parameters
Name
Description
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.
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.
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
int
The number of child processes. It only takes effect with theBatchDaemon.
↳ bootstrapFile
string
A file to load before executing the job. It's needed for registering global functions.
[[["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 BatchRunner (1.64.2)\n\nVersion latestkeyboard_arrow_down\n\n- [1.64.2 (latest)](/php/docs/reference/cloud-core/latest/Batch.BatchRunner)\n- [1.64.1](/php/docs/reference/cloud-core/1.64.1/Batch.BatchRunner)\n- [1.63.0](/php/docs/reference/cloud-core/1.63.0/Batch.BatchRunner)\n- [1.62.3](/php/docs/reference/cloud-core/1.62.3/Batch.BatchRunner)\n- [1.61.0](/php/docs/reference/cloud-core/1.61.0/Batch.BatchRunner)\n- [1.60.1](/php/docs/reference/cloud-core/1.60.1/Batch.BatchRunner)\n- [1.59.1](/php/docs/reference/cloud-core/1.59.1/Batch.BatchRunner)\n- [1.58.2](/php/docs/reference/cloud-core/1.58.2/Batch.BatchRunner)\n- [1.53.0](/php/docs/reference/cloud-core/1.53.0/Batch.BatchRunner)\n- [1.52.11](/php/docs/reference/cloud-core/1.52.11/Batch.BatchRunner)\n- [1.51.2](/php/docs/reference/cloud-core/1.51.2/Batch.BatchRunner)\n- [1.50.0](/php/docs/reference/cloud-core/1.50.0/Batch.BatchRunner)\n- [1.49.3](/php/docs/reference/cloud-core/1.49.3/Batch.BatchRunner)\n- [1.48.1](/php/docs/reference/cloud-core/1.48.1/Batch.BatchRunner) \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 BatchRunner.\n\nA class for executing jobs in batch.\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Core \\\\ Batch\n\nMethods\n-------\n\n### __construct\n\nDetermine internal implementation and loads the configuration.\n\n### registerJob\n\nRegister a job for batch execution.\n\n### submitItem\n\nSubmit an item.\n\n### getJobFromId\n\nGet the job with the given identifier.\n\n### getJobFromIdNum\n\nGet the job with the given numeric id.\n\n### getJobs\n\nGet all the jobs.\n\n### loadConfig\n\nLoad the config from the storage.\n\n### getProcessor\n\nGets the item processor."]]