Skip to content

Commit

Permalink
Develop (#12)
Browse files Browse the repository at this point in the history
* Make connection configuration mergable

* Change worker to use same logic as laravel queue

* Some refactoring.
  • Loading branch information
nicholasnet authored Jun 26, 2017
1 parent acf2276 commit e4c6bce
Show file tree
Hide file tree
Showing 3 changed files with 285 additions and 198 deletions.
2 changes: 1 addition & 1 deletion src/Type/BeanstalkdQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function size($queue = null)
{
$queue = $this->getQueue($queue);

return (int)$this->pheanstalk->statsTube($queue)->total_jobs;
return (int)$this->pheanstalk->statsTube($queue)->current_jobs_ready;
}

/**
Expand Down
6 changes: 2 additions & 4 deletions src/Type/RedisQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ public function later($delay, $job, $data = '', $queue = null)
*/
protected function laterRaw($delay, $payload, $queue = null)
{
$this->redis->zadd(
$this->getQueue($queue) . ':delayed', $this->availableAt($delay), $payload
);
$this->redis->zadd($this->getQueue($queue) . ':delayed', $this->availableAt($delay), $payload);

return ArrayHelper::get(json_decode($payload, true), 'id');
}
Expand All @@ -134,7 +132,7 @@ protected function laterRaw($delay, $payload, $queue = null)
* @param string $job
* @param mixed $data
*
* @return string
* @return array
*/
protected function createPayloadArray($job, $data = '')
{
Expand Down
Loading

0 comments on commit e4c6bce

Please sign in to comment.