Arbitrary strings, that may be reused later, but must be unique in the queue.
$job = new Job('a');
$job->setId('Update user 123');
$em->persist($job);
$em->flush();
$job = new Job('a');
$job->setId('Update user 123');
$em->persist($job);
$em->flush();
// Should fail, or silently dropped, because job with that ID is already enqueued
$job = new Job('a');
$job->setId('Update user 123');
$em->persist($job);
$em->flush();
// Wait a looong time
$job = new Job('a');
$job->setId('Update user 123');
$em->persist($job);
$em->flush();
// May succeed, when the previous job was processed
null means "current behaviour".
To be honest: Handling this on the entity manager directly makes me feel a little bit uncomfortable. Is theres a reason, why there is no layer in between (like Queue with $queue->enqueue($job);)?
Feature suggestion: Job IDs/Keys
Arbitrary strings, that may be reused later, but must be unique in the queue.
null
means "current behaviour".To be honest: Handling this on the entity manager directly makes me feel a little bit uncomfortable. Is theres a reason, why there is no layer in between (like
Queue
with$queue->enqueue($job);
)?