This class wraps a Job instance recently fetched and unserialized from some Work Queue.
The instance also records the name of the job's original work queue and the Work Server's opaque handle for that job. (That is why this class exists in the first place: we don't want to force Job implementors to have to record that stuff.)
In case of the Beanstalkd adapter,
that handle is the original \Pheanstalk\Job
instance.
Instances of this class are
returned by WorkServerAdapter::getNextQueueEntry()
and used by WorkProcessor::processNextJob()
.
Unless you process your jobs manually using getNextQueueEntry()
,
you won't need to use this class in any way.
public function __construct (Job $job, string $workQueue, $handle)
public static function fromSerializedJob (string $serializedData, string $originWorkQueue, $handle, string $jobId): self
Unserializes a stored Job instance from a Work Queue entry's raw data and wraps it in aQueueEntry
instance. Throws an UnserializationException if$serializedData
corresponded to a non-object or to a non-Job object.$serializedData
: The serialized raw data.$handle
: The Work Server adapter's representation of this job.$jobId
: A unique ID for this job. Only used for logging. Not every WorkServerAdapter implementation provides this!
public function getJob (): Job
public function getWorkQueue (): string
public function getHandle (): mixed
Internal: This is an opaque handle which belongs to the originating WorkServerAdapter. Don't use this value unless you know exactly what you're doing.