{"id":23514694,"url":"https://github.com/niqingyang/workerman-bundle","last_synced_at":"2025-04-19T14:39:58.240Z","repository":{"id":59405237,"uuid":"537125199","full_name":"niqingyang/workerman-bundle","owner":"niqingyang","description":"Symfony workerman bundle 🎉","archived":false,"fork":false,"pushed_at":"2022-09-26T16:36:08.000Z","size":76,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T00:02:13.128Z","etag":null,"topics":["symfony-bundle","symfony-runtime","workerman"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niqingyang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-15T16:59:06.000Z","updated_at":"2024-09-16T15:18:53.000Z","dependencies_parsed_at":"2022-09-16T16:33:54.706Z","dependency_job_id":null,"html_url":"https://github.com/niqingyang/workerman-bundle","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqingyang%2Fworkerman-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqingyang%2Fworkerman-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqingyang%2Fworkerman-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqingyang%2Fworkerman-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niqingyang","download_url":"https://codeload.github.com/niqingyang/workerman-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249716223,"owners_count":21315062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["symfony-bundle","symfony-runtime","workerman"],"created_at":"2024-12-25T14:10:00.737Z","updated_at":"2025-04-19T14:39:58.210Z","avatar_url":"https://github.com/niqingyang.png","language":"PHP","readme":"# workerman-bundle\n\nSymfony 的 workerman bundle，支持使用 `symfony runtime` 启动，并且支持通过 `service container` 自定义进程\n\n## 安装\n\n```bash\ncomposer require wellkit/workerman-bundle\n```\n\n## 配置\n\n1. 修改文件 `/config/bundles.php`\n\n```php\nreturn [\n    // ...\n    WellKit\\WorkermanBundle\\WorkermanBundle::class =\u003e ['all' =\u003e true],\n];\n```\n\n2. 增加配置文件 `/config/packages/workerman.yaml`\n\n```yaml\nworkerman:\n    # 服务配置\n    server:\n        # 进程名称\n        name: 'Symfony Workerman Server'\n        # 监听的协议 ip 及端口 （可选）\n        listen: http://0.0.0.0:8000\n        # 进程数 （可选，生产环境下默认为 cpu核心数*2，其他环境下默认为1）\n        count: ~\n        # 进程运行用户 （可选，默认当前用户）\n        user: ''\n        # 进程运行用户组 （可选，默认当前用户组）\n        group: ''\n        # 当前进程是否支持reload （可选，默认true）\n        reloadable: true\n        # 是否开启reusePort （可选，此选项需要php\u003e=7.0，默认为true）\n        reusePort: true\n        # transport (可选，当需要开启ssl时设置为ssl，默认为tcp)\n        transport: tcp\n        # context （可选，当transport为是ssl时，需要传递证书路径）\n        context: []\n        # After sending the stop command to the child process stopTimeout seconds,\n        # if the process is still living then forced to kill.\n        stopTimeout: 2\n        # The file to store master process PID.\n        pidFile: '%kernel.project_dir%/var/workerman.pid'\n        # Log file.\n        logFile: '%kernel.project_dir%/var/log/workerman.log'\n        # The file used to store the master process status file.\n        statusFile: '%kernel.project_dir%/var/log/workerman.status'\n        # Stdout file.\n        stdoutFile: '%kernel.project_dir%/var/log/workerman.stdout.log'\n\n    # 自定义进程的 serviceId（功能与声明 `workerman.process` 标签相同）\n    # 支持 service 相关配置参数：arguments、properties、factory 等\n    # 支持 name、listen、count、user、group、reloadable、reusePort、transport、context 参数设置\n    process:\n        # 自定义进程的名称\n        workerman.xxx:\n            # 自定义进程的类，必须声明 onWorkerStart 方法\n            class: App\\Process\\XXX\n\n        # 监听文件变动自动重启\n        workerman.monitor:\n            class: WellKit\\WorkermanBundle\\Process\\Monitor\n            arguments:\n                # the base dir\n                $basePath: '%kernel.project_dir%'\n                # the monitor dirs\n                $resource: [ './src/', './config/', './public/', './templates/' ]\n                # the file name patterns\n                $patterns: [ '*.php', '*.yaml', '*.html', '*.htm', '*.twig' ]\n                # the exclude dirs\n                $exclude: []\n```\n\n## 启动\n\n在项目根目录下执行\n\n```bash\nAPP_RUNTIME=WellKit\\\\WorkermanBundle\\\\Runtime php ./public/index.php start\n```\n\n## 参考项目\n\n- https://github.com/walkor/webman\n- https://github.com/tourze/workerman-server-bundle\n- https://github.com/manyou-io/workerman-symfony-runtime\n\n## 许可证\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniqingyang%2Fworkerman-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniqingyang%2Fworkerman-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniqingyang%2Fworkerman-bundle/lists"}