public function testCanReplayQueue()
 {
     $results = '';
     $q = new PriorityQueue();
     $q->insert('a', 1);
     $q->insert('b', 1);
     $q->insert('c', 1);
     foreach ($q as $v) {
         $results .= $v;
     }
     foreach ($q as $v) {
         $results .= $v;
     }
     $this->assertEquals('abcabc', $results);
 }
Example #2
0
 /**
  * Insert an event into the queue
  *
  * @param Proem\Filter\ChainEventInterface $event
  * @param int $priority
  */
 public function attach(ChainEventInterface $event, $priority = 0)
 {
     $this->queue->insert($event, $priority);
     return $this;
 }