Inheritance: extends Kraken\Loop\LoopInterface
Example #1
0
 /**
  *
  */
 private function stop()
 {
     if ($this->loop !== null && $this->loop->isRunning()) {
         $this->loop->stop();
     }
     if ($this->stopFlags === false) {
         $callable = $this->stopCallback;
         $callable($this);
     }
     $this->stopFlags = true;
 }
Example #2
0
 /**
  * @override
  * @inheritDoc
  */
 public function swap(LoopExtendedInterface $loop, $all = false)
 {
     $this->loop->swap($loop->getModel(), $all);
     return $this;
 }
Example #3
0
 /**
  * @override
  * @inheritDoc
  */
 public function setLoop(LoopExtendedInterface $loop = null)
 {
     $this->loop = $loop;
     $this->loopBackup = $loop !== null ? new Loop($this->reflect($this->loop->getModel())) : $loop;
 }
Example #4
0
 /**
  * @dataProvider loopsProvider
  * @param LoopExtendedInterface|LoopModelInterface|mixed $loop
  */
 public function testApiFlush_FlushesAllHandlers_WhenAllFlagSetToTrue($loop)
 {
     $stream = $this->createStream();
     $loop->onAfterTick($this->expectCallableNever());
     $loop->onBeforeTick($this->expectCallableNever());
     $loop->addWriteStream($stream, $this->expectCallableNever());
     $loop->addReadStream($stream, $this->expectCallableNever());
     $loop->erase(true);
     $loop->tick();
     unset($stream);
     unset($loop);
 }
Example #5
0
 /**
  *
  */
 public function testApiGetModel_ReturnsModel()
 {
     $this->assertSame($this->model, $this->loop->getModel());
 }
Example #6
0
 /**
  *
  */
 public function setUp()
 {
     $this->loop = new Loop(new SelectLoop());
     $this->loop->erase(true);
     $this->simulation = new Simulation($this->loop);
 }