当前位置: 首页>>代码示例>>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;未经允许,请勿转载。