Skip to content

Commit

Permalink
start_*
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor committed May 1, 2015
1 parent 70c538c commit d8a4cc4
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 18 deletions.
22 changes: 22 additions & 0 deletions Applications/Sender/start_businessworker.php
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();
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
use \Workerman\Worker;
use \Workerman\WebServer;
use \GatewayWorker\Gateway;
use \GatewayWorker\BusinessWorker;
use \Workerman\Autoloader;

// 自动加载类
require_once __DIR__ . '/../../Workerman/Autoloader.php';
Autoloader::setRootPath(__DIR__);

// gateway 进程
$gateway = new Gateway("Websocket://0.0.0.0:3232");
Expand Down Expand Up @@ -41,22 +41,6 @@
};
*/

// bussinessWorker 进程
$worker = new BusinessWorker();
// 名称
$worker->name = 'SenderBusinessWorker';
// 进程数
$worker->count = 4;


// 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'))
{
Expand Down
21 changes: 21 additions & 0 deletions Applications/Sender/start_web.php
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();
}

0 comments on commit d8a4cc4

Please sign in to comment.