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


PHP Console::setProcessName方法代碼示例

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


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

示例1: onStart

 function onStart($serv, $worker_id = 0)
 {
     //用戶修改
     $server = $this->server->getConfig();
     if (!empty($server['user'])) {
         Console::changeUser($server['user']);
     }
     if (!empty($server['name'])) {
         if ($worker_id >= $serv->setting['worker_num']) {
             Console::setProcessName('php ' . $server['name'] . ': task');
         } else {
             Console::setProcessName('php ' . $server['name'] . ': worker');
         }
     }
     Console::output($server['name'] . "[#{$worker_id}]. running. on {$server['host']}:{$server['port']}");
     register_shutdown_function(array($this, 'onError'));
 }
開發者ID:kenshin1983,項目名稱:swoole_task,代碼行數:17,代碼來源:App.php

示例2: onWorkerStart

 public function onWorkerStart($server, $workerId)
 {
     // echo __METHOD__;
     // exit();
     if ($workerId >= $this->setting['worker_num']) {
         Console::setProcessName($this->processName . ': task worker process');
     } else {
         Console::setProcessName($this->processName . ': event worker process');
     }
     if ($this->user) {
         Console::changeUser($this->user);
     }
     foreach ($this->requireFile as $v) {
         include_once $v;
     }
     if ($this->serverClass && class_exists($this->serverClass)) {
         $this->setProtocol(new $this->serverClass());
     }
     // check protocol class
     if (!$this->protocol) {
         throw new \Exception("[error] the protocol class " . $this->serverClass . " is empty or undefined");
     }
     $this->protocol->onStart($server, $workerId);
 }
開發者ID:learsu,項目名稱:php-swoole-framework,代碼行數:24,代碼來源:Server.php

示例3: onWorkerStart

 public function onWorkerStart($server, $workerId)
 {
     // echo __METHOD__;
     // exit();
     if ($workerId >= $this->setting['worker_num']) {
         Console::setProcessName($this->processName . ': task worker process');
     } else {
         Console::setProcessName($this->processName . ': event worker process');
     }
     if ($this->user) {
         Console::changeUser($this->user);
     }
     $protocol = (require_once $this->requireFile);
     //執行
     $this->setProtocol($protocol);
     // check protocol class
     if (!$this->protocol) {
         throw new \Exception("[error] the protocol class  is empty or undefined");
     }
     $this->protocol->onStart($server, $workerId);
 }
開發者ID:delphinBlue,項目名稱:tsf,代碼行數:21,代碼來源:Server.php

示例4: onManagerStart

 function onManagerStart($serv)
 {
     Console::setProcessName('php ' . $this->server['name'] . ': master -host=' . $this->server['host'] . ' -port=' . $this->server['port']);
 }
開發者ID:kenshin1983,項目名稱:swoole_task,代碼行數:4,代碼來源:Server.php


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