當前位置: 首頁>>代碼示例>>PHP>>正文


PHP LoopInterface::isTimerActive方法代碼示例

本文整理匯總了PHP中React\EventLoop\LoopInterface::isTimerActive方法的典型用法代碼示例。如果您正苦於以下問題:PHP LoopInterface::isTimerActive方法的具體用法?PHP LoopInterface::isTimerActive怎麽用?PHP LoopInterface::isTimerActive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在React\EventLoop\LoopInterface的用法示例。


在下文中一共展示了LoopInterface::isTimerActive方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isPeriodicTimerActive

 /**
  * @param string $name
  *
  * @return bool
  */
 public function isPeriodicTimerActive($name)
 {
     $tid = $this->getTid($name);
     if (!isset($this->registry[$tid])) {
         return false;
     }
     return $this->loop->isTimerActive($this->registry[$tid]);
 }
開發者ID:rsrodrig,項目名稱:MeetMeSoftware,代碼行數:13,代碼來源:ConnectionPeriodicTimer.php

示例2: isPeriodicTimerActive

 /**
  * @param TopicInterface $topic
  * @param string         $name
  *
  * @return bool
  */
 public function isPeriodicTimerActive(TopicInterface $topic, $name)
 {
     $namespace = spl_object_hash($topic);
     if (!isset($this->registry[$namespace][$name])) {
         return false;
     }
     return $this->loop->isTimerActive($this->registry[$namespace][$name]);
 }
開發者ID:rsrodrig,項目名稱:MeetMeSoftware,代碼行數:14,代碼來源:TopicPeriodicTimer.php

示例3: queueRpc

 /**
  * @param Rpc $message
  * @return PromiseInterface
  */
 protected function queueRpc(Rpc $message)
 {
     $deferred = new Deferred();
     $this->callQueue->enqueue($deferred);
     if ($this->timer === null || !$this->loop->isTimerActive($this->timer)) {
         $this->timer = $this->loop->addTimer(static::INTERVAL, function () {
             $this->checkQueue();
         });
     }
     return $deferred->promise()->then(function () use($message) {
         return $this->sendRpc($message);
     });
 }
開發者ID:gabidavila,項目名稱:reactphp-child-process-pool,代碼行數:17,代碼來源:FixedPool.php

示例4: onEnd

 /**
  *
  */
 protected function onEnd()
 {
     if ($this->requestTimer !== null && $this->loop->isTimerActive($this->requestTimer)) {
         $this->loop->cancelTimer($this->requestTimer);
     }
     if ($this->connectionTimer !== null && $this->loop->isTimerActive($this->connectionTimer)) {
         $this->loop->cancelTimer($this->connectionTimer);
     }
     $this->loop->futureTick(function () {
         if ($this->httpResponse === null) {
             $this->deferred->reject($this->error);
         }
     });
 }
開發者ID:wyrihaximus,項目名稱:react-guzzle-http-client,代碼行數:17,代碼來源:Request.php

示例5: closure

 /**
  * @param Server        $server
  * @param LoopInterface $loop
  */
 protected function closure(Server $server, LoopInterface $loop)
 {
     $this->logger->notice('Stopping server ...');
     foreach ($this->serverPushHandlerRegistry->getPushers() as $handler) {
         $handler->close();
         $this->logger->info(sprintf('Stop %s push handler', $handler->getName()));
     }
     $server->emit('end');
     $server->shutdown();
     foreach ($this->periodicRegistry->getPeriodics() as $periodic) {
         if ($periodic instanceof TimerInterface && $loop->isTimerActive($periodic)) {
             $loop->cancelTimer($periodic);
         }
     }
     $loop->stop();
     $this->logger->notice('Server stopped !');
 }
開發者ID:rsrodrig,項目名稱:MeetMeSoftware,代碼行數:21,代碼來源:StartServerListener.php

示例6: isTimerActive

 /**
  * Check if a given timer is active.
  *
  * @param TimerInterface $timer The timer to check.
  *
  * @return boolean True if the timer is still enqueued for execution.
  */
 public function isTimerActive(TimerInterface $timer)
 {
     return $this->loop->isTimerActive($timer);
 }
開發者ID:WyriHaximus,項目名稱:reactphp-event-loop-inspector,代碼行數:11,代碼來源:LoopDecorator.php


注:本文中的React\EventLoop\LoopInterface::isTimerActive方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。