/** * @param TimerInterface $timer */ public function add(TimerInterface $timer) { $interval = $timer->getInterval(); $scheduledAt = $interval + $this->getTime(); $this->timers->attach($timer, $scheduledAt); $this->scheduler->insert($timer, -$scheduledAt); }
/** * Stop time register. * * @see ZmqModel::startTimeRegister */ private function stopTimeRegister() { if ($this->rTimer !== null) { $this->rTimer->cancel(); $this->rTimer = null; $this->connectionPool->resetNow(); } }
/** * @override * @inheritDoc */ public function cancel() { $this->timer->cancel(); }
/** * */ private function unregisterPeriodicTimers() { if ($this->reqsHelperTimer !== null) { $this->reqsHelperTimer->cancel(); } if ($this->repsHelperTimer !== null) { $this->repsHelperTimer->cancel(); } }