Inheritance: extends Kraken\Loop\LoopInterface
Beispiel #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;
 }
Beispiel #2
0
 /**
  * @override
  * @inheritDoc
  */
 public function swap(LoopExtendedInterface $loop, $all = false)
 {
     $this->loop->swap($loop->getModel(), $all);
     return $this;
 }
Beispiel #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;
 }
Beispiel #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);
 }
Beispiel #5
0
 /**
  *
  */
 public function testApiGetModel_ReturnsModel()
 {
     $this->assertSame($this->model, $this->loop->getModel());
 }
Beispiel #6
0
 /**
  *
  */
 public function setUp()
 {
     $this->loop = new Loop(new SelectLoop());
     $this->loop->erase(true);
     $this->simulation = new Simulation($this->loop);
 }