Пример #1
0
 /**
  * @group redis-lists
  */
 public function testListRightPopLeftPush()
 {
     $this->assertNull($this->client->rpoplpush('foo', 'bar'));
     $this->assertEquals(array(), $this->client->lrange('bar', 0, -1));
     $this->client->rpush('foo', 'A', 'B');
     $this->client->rpush('bar', 'C', 'D');
     $this->assertEquals('B', $this->client->rpoplpush('foo', 'bar'));
     $this->assertEquals(array('A'), $this->client->lrange('foo', 0, -1));
     $this->assertEquals(array('B', 'C', 'D'), $this->client->lrange('bar', 0, -1));
 }
Пример #2
0
 /**
  * {@inheritDoc}
  */
 public function rpush($key, $value)
 {
     return $this->predis->rpush($key, $value);
 }
Пример #3
0
 public function save(StreamName $streamName, DomainMessage $event)
 {
     $data = $this->serializer->serialize($this->createEventData($event), 'json');
     $this->redis->lpush($this->getNamespaceKey($streamName, $event->getId()), $data);
     $this->redis->rpush('published_events', $data);
 }