当前位置: 首页>>代码示例>>PHP>>正文


PHP LoadBalancer::waitFor方法代码示例

本文整理汇总了PHP中LoadBalancer::waitFor方法的典型用法代码示例。如果您正苦于以下问题:PHP LoadBalancer::waitFor方法的具体用法?PHP LoadBalancer::waitFor怎么用?PHP LoadBalancer::waitFor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LoadBalancer的用法示例。


在下文中一共展示了LoadBalancer::waitFor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initLB

 /**
  * Initialise a LoadBalancer to give it appropriate chronology protection.
  *
  * If the session has a previous master position recorded, this will try to
  * make sure that the next query to a slave of that master will see changes up
  * to that position by delaying execution. The delay may timeout and allow stale
  * data if no non-lagged slaves are available.
  *
  * @param LoadBalancer $lb
  * @return void
  */
 public function initLB(LoadBalancer $lb)
 {
     if ($lb->getServerCount() <= 1) {
         return;
         // non-replicated setup
     }
     if (!$this->initialized) {
         $this->initialized = true;
         if (isset($_SESSION[__CLASS__]) && is_array($_SESSION[__CLASS__])) {
             $this->startupPositions = $_SESSION[__CLASS__];
         }
     }
     $masterName = $lb->getServerName(0);
     if (!empty($this->startupPositions[$masterName])) {
         $info = $lb->parentInfo();
         $pos = $this->startupPositions[$masterName];
         wfDebug(__METHOD__ . ": LB " . $info['id'] . " waiting for master pos {$pos}\n");
         $lb->waitFor($pos);
     }
 }
开发者ID:jpena88,项目名称:mediawiki-dokku-deploy,代码行数:31,代码来源:ChronologyProtector.php

示例2: initLB

 /**
  * Initialise a LoadBalancer to give it appropriate chronology protection.
  *
  * @param LoadBalancer $lb
  */
 function initLB($lb)
 {
     if ($this->startupPos === null) {
         if (!empty($_SESSION[__CLASS__])) {
             $this->startupPos = $_SESSION[__CLASS__];
         }
     }
     if (!$this->startupPos) {
         return;
     }
     $masterName = $lb->getServerName(0);
     if ($lb->getServerCount() > 1 && !empty($this->startupPos[$masterName])) {
         $info = $lb->parentInfo();
         $pos = $this->startupPos[$masterName];
         wfDebug(__METHOD__ . ": LB " . $info['id'] . " waiting for master pos {$pos}\n");
         $lb->waitFor($this->startupPos[$masterName]);
     }
 }
开发者ID:josephdye,项目名称:wikireader,代码行数:23,代码来源:LBFactory.php

示例3: initLB

 /**
  * Initialise a LoadBalancer to give it appropriate chronology protection.
  *
  * If the stash has a previous master position recorded, this will try to
  * make sure that the next query to a slave of that master will see changes up
  * to that position by delaying execution. The delay may timeout and allow stale
  * data if no non-lagged slaves are available.
  *
  * @param LoadBalancer $lb
  * @return void
  */
 public function initLB(LoadBalancer $lb)
 {
     if (!$this->enabled || $lb->getServerCount() <= 1) {
         return;
         // non-replicated setup or disabled
     }
     $this->initPositions();
     $masterName = $lb->getServerName($lb->getWriterIndex());
     if (!empty($this->startupPositions[$masterName])) {
         $info = $lb->parentInfo();
         $pos = $this->startupPositions[$masterName];
         wfDebugLog('replication', __METHOD__ . ": LB '" . $info['id'] . "' waiting for master pos {$pos}\n");
         $lb->waitFor($pos);
     }
 }
开发者ID:mb720,项目名称:mediawiki,代码行数:26,代码来源:ChronologyProtector.php


注:本文中的LoadBalancer::waitFor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。