Skip to content

Commit

Permalink
A bit of a ture - switched lpush to rpush
Browse files Browse the repository at this point in the history
Otherwise this works as a "last in, first out" queue.
  • Loading branch information
justinrainbow committed Jul 23, 2012
1 parent f0ab355 commit fe3393e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Presque/Storage/PhpredisStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function getPrefix()

public function push($listName, $payload)
{
$this->connection->lPush($listName, json_encode($payload));
$this->connection->rPush($listName, json_encode($payload));
}

public function pop($listName, $waitTimeout = null)
Expand Down
2 changes: 1 addition & 1 deletion src/Presque/Storage/PredisStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getPrefix()

public function push($listName, $payload)
{
$this->connection->lpush($this->getKey($listName), json_encode($payload));
$this->connection->rpush($this->getKey($listName), json_encode($payload));
}

public function pop($listName, $waitTimeout = null)
Expand Down
2 changes: 1 addition & 1 deletion tests/Presque/Tests/Storage/PhpredisStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testPushingDataOntoList()

$this->redis
->expects($this->once())
->method('lPush')
->method('rPush')
->with($this->equalTo('list'), $this->equalTo(json_encode($payload)));

$this->storage->push('list', $payload);
Expand Down
2 changes: 1 addition & 1 deletion tests/Presque/Tests/Storage/PredisStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testPushingDataOntoList()
);

$this->predis
->shouldReceive('lpush')
->shouldReceive('rpush')
->with('list', json_encode($payload))
->once();

Expand Down

0 comments on commit fe3393e

Please sign in to comment.