Google Cloud PHP shared dependency, providing functionality useful to all components. Client - Class BatchJob (1.60.0)

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 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 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.

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.

Returns
Type Description
float

getBatchSize

Returns the batch size.

Returns
Type Description
int

Constants

DEFAULT_BATCH_SIZE

Value: 100

DEFAULT_CALL_PERIOD

Value: 2.0

DEFAULT_WORKERS

Value: 1