identifier = $identifier; $this->func = $func; $this->id = $id; $options += ['bootstrapFile' => null, 'numWorkers' => 1]; $this->numWorkers = $options['numWorkers']; $this->bootstrapFile = $options['bootstrapFile']; } /** * Runs the job loop. This is expected to be a blocking call. */ public function run() { if ($this->bootstrapFile) { require_once $this->bootstrapFile; } call_user_func($this->func); } }