截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Manager.php 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: yunwuxin <448901948@qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace think\swoole;
  12. use think\swoole\concerns\InteractsWithCoordinator;
  13. use think\swoole\concerns\InteractsWithHttp;
  14. use think\swoole\concerns\InteractsWithPools;
  15. use think\swoole\concerns\InteractsWithQueue;
  16. use think\swoole\concerns\InteractsWithRpcServer;
  17. use think\swoole\concerns\InteractsWithRpcClient;
  18. use think\swoole\concerns\InteractsWithServer;
  19. use think\swoole\concerns\InteractsWithSwooleTable;
  20. use think\swoole\concerns\InteractsWithWebsocket;
  21. use think\swoole\concerns\WithApplication;
  22. use think\swoole\concerns\WithContainer;
  23. /**
  24. * Class Manager
  25. */
  26. class Manager
  27. {
  28. use InteractsWithCoordinator,
  29. InteractsWithServer,
  30. InteractsWithSwooleTable,
  31. InteractsWithHttp,
  32. InteractsWithWebsocket,
  33. InteractsWithPools,
  34. InteractsWithRpcClient,
  35. InteractsWithRpcServer,
  36. InteractsWithQueue,
  37. WithContainer,
  38. WithApplication;
  39. /**
  40. * Server events.
  41. *
  42. * @var array
  43. */
  44. protected $events = [
  45. 'start',
  46. 'shutDown',
  47. 'workerStart',
  48. 'workerStop',
  49. 'workerError',
  50. 'workerExit',
  51. 'packet',
  52. 'task',
  53. 'finish',
  54. 'pipeMessage',
  55. 'managerStart',
  56. 'managerStop',
  57. 'request',
  58. ];
  59. /**
  60. * Initialize.
  61. */
  62. protected function initialize(): void
  63. {
  64. $this->prepareTables();
  65. $this->preparePools();
  66. $this->prepareWebsocket();
  67. $this->setSwooleServerListeners();
  68. $this->prepareRpcServer();
  69. $this->prepareQueue();
  70. $this->prepareRpcClient();
  71. }
  72. }