public function attach(\stdClass $jobWrapper) { // attach the job wrapper $this->synchronized(function (QueueWorker $self, \stdClass $jw) { $self->jobsToExecute[$jw->jobId] = $jw; }, $this, $jobWrapper); }