Skip to content

Commit

Permalink
tweak extension points
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 23, 2017
1 parent 1a4fe3e commit 7fbac1c
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/Illuminate/Queue/RedisQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ class RedisQueue extends Queue implements QueueContract
*/
protected $retryAfter = 60;

/**
* The last delayed payload sent by the queue.
*
* @var string
*/
protected $lastDelayedPayload;

/**
* Create a new Redis queue instance.
*
Expand Down Expand Up @@ -80,7 +73,7 @@ public function size($queue = null)
/**
* Push a new job onto the queue.
*
* @param string $job
* @param object|string $job
* @param mixed $data
* @param string $queue
* @return mixed
Expand Down Expand Up @@ -109,15 +102,26 @@ public function pushRaw($payload, $queue = null, array $options = [])
* Push a new job onto the queue after a delay.
*
* @param \DateTime|int $delay
* @param string $job
* @param object|string $job
* @param mixed $data
* @param string $queue
* @return mixed
*/
public function later($delay, $job, $data = '', $queue = null)
{
$this->lastDelayedPayload = $payload = $this->createPayload($job, $data);
return $this->laterRaw($delay, $this->createPayload($job, $data), $queue);
}

/**
* Push a raw job onto the queue after a delay.
*
* @param \DateTime|int $delay
* @param string $payload
* @param string $queue
* @return mixed
*/
protected function laterRaw($delay, $payload, $queue = null)
{
$this->getConnection()->zadd(
$this->getQueue($queue).':delayed', $this->availableAt($delay), $payload
);
Expand Down

0 comments on commit 7fbac1c

Please sign in to comment.