diff --git a/src/RedisQueue.php b/src/RedisQueue.php index f5f49ca8..749c76f2 100644 --- a/src/RedisQueue.php +++ b/src/RedisQueue.php @@ -95,6 +95,20 @@ public function later($delay, $job, $data = '', $queue = null) { $payload = (new JobPayload($this->createPayload($job, $queue, $data)))->prepare($job)->value; + if (method_exists($this, 'enqueueUsing')) { + return $this->enqueueUsing( + $job, + $payload, + $queue, + $delay, + function ($payload, $queue, $delay) { + return tap(parent::laterRaw($delay, $payload, $queue), function () use ($payload, $queue) { + $this->event($this->getQueue($queue), new JobPushed($payload)); + }); + } + ); + } + return tap(parent::laterRaw($delay, $payload, $queue), function () use ($payload, $queue) { $this->event($this->getQueue($queue), new JobPushed($payload)); });