Phive\Queue\SysVQueue::pop PHP Method

pop() public method

public pop ( )
    public function pop()
    {
        if (!msg_receive($this->getQueue(), -time(), $eta, $this->itemMaxLength, $item, $this->serialize, MSG_IPC_NOWAIT, $errorCode)) {
            throw MSG_ENOMSG === $errorCode ? new NoItemAvailableException($this) : new QueueException($this, self::getErrorMessage($errorCode), $errorCode);
        }
        return $item;
    }

Usage Example

Beispiel #1
0
 /**
  * @dataProvider provideItemsOfVariousTypes
  */
 public function testSupportItemTypeWithSerializerLoose($item)
 {
     $handler = self::getHandler();
     $key = $handler->getOption('key');
     $queue = new SysVQueue($key, true);
     $queue->push($item);
     $this->assertEquals($item, $queue->pop());
 }