@@ -38,13 +38,6 @@ class RedisQueue extends Queue implements QueueContract
3838 */
3939 protected $ retryAfter = 60 ;
4040
41- /**
42- * The last delayed payload sent by the queue.
43- *
44- * @var string
45- */
46- protected $ lastDelayedPayload ;
47-
4841 /**
4942 * Create a new Redis queue instance.
5043 *
@@ -80,7 +73,7 @@ public function size($queue = null)
8073 /**
8174 * Push a new job onto the queue.
8275 *
83- * @param string $job
76+ * @param object| string $job
8477 * @param mixed $data
8578 * @param string $queue
8679 * @return mixed
@@ -109,15 +102,26 @@ public function pushRaw($payload, $queue = null, array $options = [])
109102 * Push a new job onto the queue after a delay.
110103 *
111104 * @param \DateTime|int $delay
112- * @param string $job
105+ * @param object| string $job
113106 * @param mixed $data
114107 * @param string $queue
115108 * @return mixed
116109 */
117110 public function later ($ delay , $ job , $ data = '' , $ queue = null )
118111 {
119- $ this ->lastDelayedPayload = $ payload = $ this ->createPayload ($ job , $ data );
112+ return $ this ->laterRaw ($ delay , $ this ->createPayload ($ job , $ data ), $ queue );
113+ }
120114
115+ /**
116+ * Push a raw job onto the queue after a delay.
117+ *
118+ * @param \DateTime|int $delay
119+ * @param string $payload
120+ * @param string $queue
121+ * @return mixed
122+ */
123+ protected function laterRaw ($ delay , $ payload , $ queue = null )
124+ {
121125 $ this ->getConnection ()->zadd (
122126 $ this ->getQueue ($ queue ).':delayed ' , $ this ->availableAt ($ delay ), $ payload
123127 );
0 commit comments