/** * */ private function stopTimeRegister() { if ($this->rTimer !== null) { $this->rTimer->cancel(); $this->rTimer = null; $this->connectionPool->resetNow(); } }
/** * Schedule a timer for execution. * * @param TimerInterface $timer */ private function scheduleTimer(TimerInterface $timer) { $flags = Event::TIMEOUT; if ($timer->isPeriodic()) { $flags |= Event::PERSIST; } $event = new Event($this->eventBase, -1, $flags, $this->timerCallback, $timer); $this->timerEvents[$timer] = $event; $event->add($timer->getInterval()); }
/** * @override */ public function cancel() { $this->timer->cancel(); }