/** * */ 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; }
/** * @dataProvider loopsProvider * @param LoopExtendedInterface|LoopModelInterface|mixed $loop */ public function testApiStartAndApiStop_StartsAndStopsLoop($loop) { $loop->onAfterTick(function () use($loop) { $this->assertTrue($loop->isRunning()); $loop->stop(); $this->assertFalse($loop->isRunning()); }); $loop->start(); unset($loop); }