Startup workers.

@param string $poolOnly If set only workers of given pool will be started.
@return void
194606
public function start(string $poolOnly = '') : void
    {
        $this->reloadPids();

        foreach ($this->poolsConfig as $pool => $workerConfig) {
            // don't start workers of different type if filter is set
            if (!empty($poolOnly) && $poolOnly !== $pool) {
                continue;
            }

            // don't start new workers if already running:
            if (!empty($this->pids[$pool])) {
                continue;
            }

            // startup the workers:
            for ($i = 0; $i < $workerConfig['instances']; $i++) {
                $this->startupWorker($pool);
            }
        }
    }
555077
void init(Set<String> queues, 
            CapacitySchedulerConf capacityConf) {
    for (String queue : queues) {
      int userlimit = capacityConf.getMinimumUserLimitPercent(queue);
      int maxUsersToInitialize = ((100 / userlimit) + MAX_ADDITIONAL_USERS_TO_INIT);
      int maxJobsPerUserToInitialize = capacityConf
          .getMaxJobsPerUserToInitialize(queue);
      QueueInfo qi = new QueueInfo(queue, maxUsersToInitialize,
          maxJobsPerUserToInitialize);
      jobQueues.put(queue, qi);
    }
    sleepInterval = capacityConf.getSleepInterval();
    poolSize = capacityConf.getMaxWorkerThreads();
    if (poolSize > queues.size()) {
      poolSize = queues.size();
    }
    assignThreadsToQueues();
    Collection<JobInitializationThread> threads = threadsToQueueMap.values();
    for (JobInitializationThread t : threads) {
      if (!t.isAlive()) {
        t.setDaemon(true);
        t.start();
      }
    }
  }
1052776
public function onStart()
    {
        $this->setProcessName('master process');
        $this->createPidFile();

        $this->container->event->trigger('swoole.start', func_get_args());
    }
946098
def initialize_worker(self, process_num=None):
        
        for p in self.producers:
            p.initialize_worker(process_num)
        # self.initial_state.process = process_num
        self.random.seed(hash(self.seed) + hash(process_num))
1107309
def start
      Filum.logger.info "Starting Workerpool"
      Larva::WorkerPool.start(@processors)
      Filum.logger.info "Workerpool Finished"
    end
870158
public function onWorkerStart($server)
    {
        $this->clearCache();

        $this->container->make('events')->dispatch('swoole.workerStart', func_get_args());

        // don't init laravel app in task workers
        if ($server->taskworker) {
            $this->setProcessName('task process');

            return;
        }
        $this->setProcessName('worker process');

        // clear events instance in case of repeated listeners in worker process
        Facade::clearResolvedInstance('events');

        // prepare laravel app
        $this->getApplication();

        // bind after setting laravel app
        $this->bindToLaravelApp();

        // prepare websocket handler and routes
        if ($this->isServerWebsocket) {
            $this->prepareWebsocketHandler();
            $this->loadWebsocketRoutes();
        }
    }
1358698
public function init()
    {
        if ($this->isEnabled()) {
            $this->xmppclient = \PHPDaemon\Clients\XMPP\Pool::getInstance();
        }
    }
287198
protected function startup()
    {
        $this->log(array('message' => 'Starting worker ' . $this, 'data' => array('type' => 'start', 'worker' => (string) $this)), self::LOG_TYPE_INFO);

        $this->registerSigHandlers();
        $this->pruneDeadWorkers();
        Resque_Event::trigger('beforeFirstFork', $this);
        $this->registerWorker();
    }
355997
public function start() {
        if (!$this->isStarted) {
            $this->generateIpcServer();
            $this->isStarted = true;
            for ($i=0;$i<$this->poolSizeMin;$i++) {
                $this->spawnWorker();
            }
            $this->registerTaskTimeoutWatcher();
        }

        return $this;
    }
512877
public function setAutostart($autostart)
    {
        if (is_bool($autostart) === true) {
            $this->autostart = $autostart;
        } else {
            $msg = "The 'autostart' argument must be a boolean value, '" . gettype($autostart) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
629143
private void initPool() {
        if (logger.isWarnEnabled()) {
            logger.warn("Start to initialize connection pool with url: " + url + " ...");
        }

        for (int i = 0; (i < initialSize) && (xpool.size() < initialSize); i++) {
            pool.lock();

            try {
                if (pool.isClosed()) {
                    break;
                }

                if ((i < initialSize) && (xpool.size() < initialSize)) {
                    PoolableConnection poolableConn = newConnection();

                    if (!pool.add(poolableConn)) {
                        detroyConnection(poolableConn);
                    }
                }
            } finally {
                pool.unlock();
            }
        }

        if (logger.isWarnEnabled()) {
            logger.warn("End to initialize connection pool with url: " + url + " ...");
        }
    }
1324317
protected function applyCasts(bool $scalarOnly = false): void
    {
        // @codeCoverageIgnoreStart
        if ( ! $scalarOnly) {

            foreach (array_keys($this->casts()) as $key) {

                $this->applyCast($key);
            }

            return;
        }
        // @codeCoverageIgnoreEnd

        foreach ($this->casts() as $key => $type) {

            if ( ! in_array($type, static::SCALAR_CASTS)) {
                continue;
            }

            $this->applyCast($key);
        }
    }
1024216
void ensurePrestart() {
        int wc = workerCountOf(ctl.get());
        if (wc < corePoolSize)
            addWorker(null, true);
        else if (wc == 0)
            addWorker(null, false);
    }
632104
public function onSwooleWorkerStart($serv, $workerId)
    {
        parent::onSwooleWorkerStart($serv, $workerId);
        if (!$this->isTaskWorker()) {
            $this->whoops = new Run();
            $this->whoops->writeToOutput(false);
            $this->whoops->allowQuit(false);
            $handler = new SDPageHandler();
            $handler->setPageTitle("出现错误了");
            $this->whoops->pushHandler($handler);
            $this->setTemplateEngine();
        }
    }
599696
def start_workers(self):
        """"""

        if self._started:
            raise InternalError("The method start() was called twice on a BaseRunnable object.")

        self._started = True

        for worker in self._workers:
            worker.start()
320002
public function start()
    {
        RequestContext::destroy();
        PoolManager::clearPools();
        CacheManager::clearPools();
        App::createServers();
        ServerManage::getServer('main')->getSwooleServer()->start();
    }
519106
private void startWorkers(final ExecutorService executorService, final int numTasks) {
        for (int i = 0; i < numTasks; i++) {
            workerFutures.add(executorService.submit(new Callable<Void>() {
                @Override
                public Void call() throws Exception {
                    runWorkLoop();
                    return null;
                }
            }));
        }
    }