예제 #1
0
 public function testConsumeViaQueue()
 {
     $this->markTestSkipped('Consuming via queue does not work');
     $this->consumerTopic->consumeQueueStart(self::PARTITION, RD_KAFKA_OFFSET_BEGINNING, $this->queue);
     $this->consumerTopic->consume(self::PARTITION, 100);
     $this->consumerTopic->consumeStop(self::PARTITION);
     $message = $this->queue->consume(200);
     $this->assertInstanceOf(Message::class, $message);
 }
예제 #2
0
 public function testQueueNoArgs()
 {
     Queue::put('MyJob');
     Queue::put('MyJob');
     Queue::put('MyJob');
     $sql = "select count(*) from queue";
     $this->assertEquals(3, $this->_db->getOne($sql));
     $this->assertTrue(Queue::consume('MyJob'));
     $this->assertTrue(Queue::consume('MyJob'));
     $this->assertTrue(Queue::consume('MyJob'));
     $sql = "select count(*) from queue";
     $this->assertEquals(0, $this->_db->getOne($sql));
     $this->assertNull(Queue::consume('MyJob'));
 }