public function insert($data, $priority = 0)
    {
        $this->data[] = [
            'data'     => $data,
            'priority' => $priority,
        ];

        $priority = array($priority, $this->max--);
        $this->getSplQueue()->insert($data, $priority);
        return $this;
    }
public function insert($data, $priority = 0)
    {
        $this->data[] = [
            'data'     => $data,
            'priority' => $priority,
        ];

        $priority = array($priority, $this->max--);
        $this->getSplQueue()->insert($data, $priority);
        return $this;
    }
public function insert ( $ data , $ priority = 0 ) { $ this -> data [ ] = [ 'data' => $ data , 'priority' => $ priority , ] ; $ priority = array ( $ priority , $ this -> max -- ) ; $ this -> getSplQueue ( ) -> insert ( $ data , $ priority ) ; return $ this ; }
Insert an item into the queue.

@param mixed $data
@param int $priority
Insert an item into the queue .