-
-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
45 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
use \Workerman\Worker; | ||
use \GatewayWorker\BusinessWorker; | ||
use \Workerman\Autoloader; | ||
|
||
// 自动加载类 | ||
require_once __DIR__ . '/../../Workerman/Autoloader.php'; | ||
Autoloader::setRootPath(__DIR__); | ||
|
||
// bussinessWorker 进程 | ||
$worker = new BusinessWorker(); | ||
// 名称 | ||
$worker->name = 'SenderBusinessWorker'; | ||
// 进程数 | ||
$worker->count = 4; | ||
|
||
|
||
// 如果不是在根目录启动,则运行runAll方法 | ||
if(!defined('GLOBAL_START')) | ||
{ | ||
Worker::runAll(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
use \Workerman\Worker; | ||
use \Workerman\WebServer; | ||
use \Workerman\Autoloader; | ||
|
||
// 自动加载类 | ||
require_once __DIR__ . '/../../Workerman/Autoloader.php'; | ||
Autoloader::setRootPath(__DIR__); | ||
|
||
// WebServer | ||
$web = new WebServer("http://0.0.0.0:3333"); | ||
// WebServer进程数 | ||
$web->count = 2; | ||
// 设置域名与站点目录映射关系 | ||
$web->addRoot('www.your_domain.com', __DIR__.'/Web'); | ||
|
||
// 如果不是在根目录启动,则运行runAll方法 | ||
if(!defined('GLOBAL_START')) | ||
{ | ||
Worker::runAll(); | ||
} |