start_businessworker.php 1017 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * This file is part of workerman.
  4. *
  5. * Licensed under The MIT License
  6. * For full copyright and license information, please see the MIT-LICENSE.txt
  7. * Redistributions of files must retain the above copyright notice.
  8. *
  9. * @author walkor<walkor@workerman.net>
  10. * @copyright walkor<walkor@workerman.net>
  11. * @link http://www.workerman.net/
  12. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  13. */
  14. use \Workerman\Worker;
  15. use \Workerman\WebServer;
  16. use \GatewayWorker\Gateway;
  17. use \GatewayWorker\BusinessWorker;
  18. use \Workerman\Autoloader;
  19. // 自动加载类
  20. require_once __DIR__ . '/../../vendor/autoload.php';
  21. // bussinessWorker 进程
  22. $worker = new BusinessWorker();
  23. // worker名称
  24. $worker->name = 'DeverImBusinessWorker';
  25. // bussinessWorker进程数量
  26. $worker->count = DEVER_IM_WORKER;
  27. // 服务注册地址
  28. $worker->registerAddress = '0.0.0.0:' . DEVER_IM_IN_PORT;
  29. // 如果不是在根目录启动,则运行runAll方法
  30. if(!defined('GLOBAL_START'))
  31. {
  32. Worker::runAll();
  33. }