WorkerJobInterface
extends
WorkerInterface, JobInterface, JsonSerializable, JsonDeserializable
in
Interface for worker jobs.
Unlike the old WorkerBase, the worker configuration is stored in the
instance rather than passed to the run() method.
Use the Json serialisation interfaces to convert the job to and from JSON.
Table of Contents
Methods
- fromJson() : static
- Create an object from a JSON array.
- getId() : string
- A unique identifier.
- getMetricNames() : array<int, string>
- Gets the metric names.
- getName() : string
- Gets the job name
- run() : void
- Run the job.
Methods
fromJson()
Create an object from a JSON array.
public
static fromJson(array<string|int, mixed> $json) : static
Parameters
- $json : array<string|int, mixed>
Return values
staticgetId()
A unique identifier.
public
getId() : string
Return values
stringgetMetricNames()
Gets the metric names.
public
getMetricNames() : array<int, string>
Return values
array<int, string>getName()
Gets the job name
public
getName() : string
Return values
stringrun()
Run the job.
public
run() : void