跳转到首页，在用户未登录的情况下执行

@ignore
482660
function redirectToIndex() {
            var baseURL = window.DEBUG
                ? 'index-debug.html'
                : 'index.html';
            location.href = baseURL + location.hash;
            // 在`Promise`中，抛出异常会使其进入失败状态，
            // 一般来说跳转了就不会有下面的代码执行，这里就是防止进入成功状态
            throw new Error('Failed to redirect to index');
        }
520100
public function run()
    {
        $this->addPending();
        $this->ran = true;

        while (count($this->inProcess) !== 0) {

            $this->monitorPending();
        }

        // Clear the references for callbacks.
        $this->onSuccess = null;
        $this->onError = null;
    }
1203753
public function run()
        {
            $configs = $this->configs;
            $params = $this->params;
            foreach ($configs as $name => $value) {
                if ($value === '*') {
                    continue;
                }
                if (isset($params[$name])) {
                    $param = $params[$name];
                    if (is_array($value)) {
                        $check = $this->arrayValueChecker($param, $value);
                    } elseif (is_string($value)) {
                        $check = $this->stringValueChecker($param, $value);
                    }
                    if (false === $check) {
                        break;
                    }
                } else {
                    continue;
                }
            }
            if (false === $check) {
                $this->stopPageProcess();
            }
        }
646520
protected synchronized void secondScan() {

        // 该函数必须第一次运行后才能运行
        if (!isFirstInit) {
            LOGGER.info("should run First Scan before Second Scan.");
            return;
        }

        // 第二次扫描也只能做一次
        if (isSecondInit) {
            LOGGER.info("should not run twice.");
            return;
        }

        LOGGER.info("******************************* DISCONF START SECOND SCAN *******************************");

        try {

            // 扫描回调函数
            if (scanMgr != null) {
                scanMgr.secondScan();
            }

            // 注入数据至配置实体中
            // 获取数据/注入/Watch
            if (disconfCoreMgr != null) {
                disconfCoreMgr.inject2DisconfInstance();
            }

        } catch (Exception e) {
            LOGGER.error(e.toString(), e);
        }

        isSecondInit = true;

        //
        // 不开启 则不要打印变量map
        //
        if (DisClientConfig.getInstance().ENABLE_DISCONF) {

            //
            String data = DisconfStoreProcessorFactory.getDisconfStoreFileProcessor()
                    .confToString();
            if (!StringUtils.isEmpty(data)) {
                LOGGER.info("Conf File Map: {}", data);
            }

            //
            data = DisconfStoreProcessorFactory.getDisconfStoreItemProcessor()
                    .confToString();
            if (!StringUtils.isEmpty(data)) {
                LOGGER.info("Conf Item Map: {}", data);
            }
        }
        LOGGER.info("******************************* DISCONF END *******************************");
    }
1197090
public static function call()
	{
		$yurunControl = autoLoadControl(self::$control,self::$action);
		// 控制器是否存在
		if (false !== $yurunControl)
		{
			// 实例化控制器
			if (method_exists($yurunControl, self::$action))
			{
				$reflection = new ReflectionMethod($yurunControl, self::$action);
				self::prepareData($reflection->getParameters());
				unset($reflection);
				$returnResult = call_user_func_array(array(&$yurunControl,self::$action),self::$data);
			}
			else
			{
				$action = '_R_' . self::$action;
				if (method_exists($yurunControl, $action))
				{
					$reflection = new ReflectionMethod($yurunControl, $action);
					self::prepareData($reflection->getParameters());
					unset($reflection);
					$returnResult = call_user_func_array(array(&$yurunControl,$action),self::$data);
				}
				else
				{
					return false;
				}
			}
		}
		else
		{
			return false;
		}
		$param = array('returnResult'=>$returnResult);
		Event::trigger('YURUN_CONTROL_EXEC_COMPLETE',$param);
		return true;
	}
1126678
@Override
	public void run() {
		Stopwatch stopwatch = SimonManager.getStopwatch(NAME);
		try (Split ignored = stopwatch.start();) {
			sleep(SLEEP);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		// signal to latch that the thread is finished
		latch.countDown();
	}
991664
@Override
    public void execute() {
        try {
            String str = editor.readLine("Find:");
            editor.findNext(str);
            FindContext.setLastSearch(str);
        } catch (IOException e) {
            //noop
        }
    }
11602
private function listenAfter()
    {
        //监听器结束
        //$_listeners=array_reverse($this->m_listeners);
        $_listeners=$this->m_listeners;
        foreach ($_listeners as $listener){
            $listener->listenAfter($this->m_context);
        }
    }
195618
public function run()
	{
		if( isset( $this->config['task_list'] ) && !empty( $this->config['task_list'] ) ){
			$task_list            = $this->config['task_list'];
			$cronLastExecTimeList = [];
			// 定时执行
			ServerManager::getInstance()->getServer()->tick( $this->config['loop_time'] * 1000, function() use ( &$task_list, &$cronLastExecTimeList ){
				// 分别执行
				foreach( $task_list as $name => $option ){
					try{
						// 是到期需执行 当前时间 > 最后一次时间 + 间隔时间
						$last_time     = isset( $cronLastExecTimeList[$name] ) ? $cronLastExecTimeList[$name] : 0;
						$current_time  = time();
						$interval_time = ceil( $option['interval_time'] );

						if( $current_time > ($last_time + $interval_time) ){
							// 设置最后一次执行时间 不可等任务执行完毕后再设置时间，因为会阻塞导致每秒进行一次
							$cronLastExecTimeList[$name] = $current_time;
							// 检测是否可执行
							if( \ezswoole\Cron::checkTask( $name, $option ) === true ){
								\EasySwoole\Core\Swoole\Task\TaskManager::async( function() use ( $name, $option ){
									\ezswoole\Cron::exec( $name, $option );
									return true;
								} );
							} else{
								// 删除该任务
								unset( $task_list[$name] );
							}
						}
					} catch( \Exception $e ){
						\EasySwoole\EasySwoole\Logger::getInstance()->log($e->getTraceAsString(),'error');
					}
				}
			} );
		}
		return true;
	}
675934
@Override
	final public void run() {
		try {
			if(args.length>0) handleCommand(args);
			else runImpl();
			status="Done";
		} catch(IOException exception) {
			this.err.println(getName()+": "+exception.getMessage());
			status="IO Error: "+exception.getMessage();
			this.err.flush();
		} catch(SQLException exception) {
			this.err.println(getName()+": "+exception.getMessage());
			status="SQL Error: "+exception.getMessage();
			this.err.flush();
		} catch(ThreadDeath TD) {
			throw TD;
		} catch(Throwable T) {
			ErrorPrinter.printStackTraces(T, this.err);
			status="Error: "+T.toString();
			this.err.flush();
		} finally {
			if(Thread.currentThread()==thread) thread=null;
		}
	}
1054965
public function actionRun()
    {
        $crontab = Task::findAll(['switch' => Task::SWITCH_ACTIVE]);
        $tasks = [];

        foreach ($crontab as $task) {
            // 第一次运行,先计算下次运行时间
            if (!$task->next_rundate) {
                $task->next_rundate = $task->getNextRunDate();
                $task->save(false);
                continue;
            }
            // 判断运行时间到了没
            if ($task->next_rundate <= date('Y-m-d H:i:s')) {
                $tasks[] = $task;
            }
        }

        $this->executeTask($tasks);
        return ExitCode::OK;
    }
431832
protected function wait()
    {
        $timer          = 0;
        $timeout        = $this->getWaitTimeout();
        $interval       = $this->checkInterval;
        $intervalSecond = $this->checkInterval / 1000;

        while ($timer <= $timeout) {
            // 等到了可用的空闲资源
            if ($res = $this->getFreeQueue()->pop()) {
                return $res;
            }

            $timer += $interval;
            // 无空闲资源可用， 进入等待状态
            Coroutine::sleep($intervalSecond);
        }

        throw new \RuntimeException("No resources available. Waiting timeout($timeout ms) for get resource.");
    }
1366694
function run() {
  const current = now();
  const queue = timeoutQueue.slice();
  let interval = INTERVAL_MAX;

  timeoutQueue.length = 0;

  // Reset
  if (runRafId > 0 || runTimeoutId > 0) {
    stop();
  }

  for (let i = queue.length - 1; i >= 0; i--) {
    const item = queue[i];

    if (!item.cancelled) {
      const duration = item.time - current;

      if (duration <= 0) {
        if (isDev) {
          debug('timeout triggered for "%s" at %s', item.id, new Date().toLocaleTimeString());
        }
        item.fn.apply(item.fn, item.args);
      } else {
        // Store smallest duration
        if (duration < interval) {
          interval = duration;
        }
        timeoutQueue.push(item);
      }
    }
  }

  // Loop
  if (timeoutQueue.length > 0) {
    // Use raf if requested interval is less than cutoff
    if (interval < INTERVAL_CUTOFF) {
      runRafId = raf(run);
    } else {
      runTimeoutId = setTimeout(run, interval);
    }
  }
}
553427
@Override
   public void run()
   {
      try {
         startBarrier.await();

         int idleCount = 0;
         while (!isRunning.compareAndSet(idleCount > LINGER_ITERATIONS && deadPool.isEmpty() && completionKeyToProcessMap.isEmpty(), false)) {
            idleCount = (!shutdown && process()) ? 0 : (idleCount + 1);
         }
      }
      catch (Exception e) {
         // TODO: how to handle this error?
         e.printStackTrace();
         isRunning.set(false);
      }
   }
738602
public void run() {
    int maxruns = this.maxruns, maxsmall = this.maxsmall;
    double oldchi = getChiSq();
    while(maxruns-- > 0) {
      iterate();
      double newchi = getChiSq(), deltachi = newchi - oldchi;
      oldchi = newchi;
      // stop condition: only a small improvement in Chi.
      if(deltachi < 0 && deltachi > -small && --maxsmall < 0) {
        break;
      }
    }
  }
1330373
function run() {
	var len = series.length,
		ctx = context(),
		i = 0;

	series[ i ].call( ctx, next );

	function next() {
		i += 1;
		if ( i < len ) {
			series[ i ].call( ctx, next );
		}
	}
}
202374
@Override
    public void execute() {
        if ((str == null || str.isEmpty()) && !FindContext.isAvailable()) {
            try {
                str = editor.readLine("Find previous:");
                editor.findPrevious(str);
                FindContext.setLastSearch(str);
            } catch (IOException e) {
                //noop
            }
        } else if (FindContext.isAvailable()) {
            editor.findPrevious(FindContext.getLastSearch());
        } else {
            editor.findPrevious(str);
            FindContext.setLastSearch(str);
        }
    }