{"id":16826767,"url":"https://github.com/huanghantao/tinyswoole","last_synced_at":"2025-09-07T04:36:53.823Z","repository":{"id":59084363,"uuid":"158372584","full_name":"huanghantao/tinyswoole","owner":"huanghantao","description":"a php server extension","archived":false,"fork":false,"pushed_at":"2019-01-22T06:48:22.000Z","size":228,"stargazers_count":25,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-11T03:43:36.580Z","etag":null,"topics":["c","php","php-extension","php7","swoole"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huanghantao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-20T10:37:52.000Z","updated_at":"2023-09-22T03:26:21.000Z","dependencies_parsed_at":"2022-09-12T04:40:31.094Z","dependency_job_id":null,"html_url":"https://github.com/huanghantao/tinyswoole","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/huanghantao/tinyswoole","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huanghantao%2Ftinyswoole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huanghantao%2Ftinyswoole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huanghantao%2Ftinyswoole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huanghantao%2Ftinyswoole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huanghantao","download_url":"https://codeload.github.com/huanghantao/tinyswoole/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huanghantao%2Ftinyswoole/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265004932,"owners_count":23696514,"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":["c","php","php-extension","php7","swoole"],"created_at":"2024-10-13T11:18:22.241Z","updated_at":"2025-07-12T14:41:40.258Z","avatar_url":"https://github.com/huanghantao.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Description\n\na tiny [swoole](https://github.com/swoole/swoole-src)\n\n## Create server\n\n```php\n\u003c?php\n\n$serv = new TinySwoole\\Server('127.0.0.1', 9501, TSWOOLE_TCP);\n$serv-\u003estart();\n\n```\n\n## Set parameters\n\n```php\n$serv-\u003eset([\n    'reactor_num' =\u003e 2,\n]);\n```\n\n## Add the server start event callback\n\n```php\n\u003c?php\n\nfunction onStart()\n{\n    print_r(\"server is running...\" . PHP_EOL);\n}\n\n$serv = new TinySwoole\\Server('127.0.0.1', 9501, TSWOOLE_TCP);\n$serv-\u003eon(\"Start\", \"onStart\");\n$serv-\u003estart();\n\n```\n\n## Add the server connect event callback\n\n```php\n\u003c?php\n\nfunction onConnect($fd)\n{\n    print_r(\"client[{$fd}] is connected\" . PHP_EOL);\n}\n\n$serv = new TinySwoole\\Server('127.0.0.1', 9501, TSWOOLE_TCP);\n$serv-\u003eon(\"Connect\", \"onConnect\");\n$serv-\u003estart();\n\n```\n\n## Add the server receive event callback\n\n```php\n\u003c?php\n\nfunction onReceive($serv, $fd, $data)\n{\n    print_r(\"receive data from client[{$fd}]: {$data}\");\n}\n\n$serv = new TinySwoole\\Server('127.0.0.1', 9501, TSWOOLE_TCP);\n$serv-\u003eon(\"Receive\", \"onReceive\");\n$serv-\u003estart();\n\n```\n\n## send data to client\n\n```php\n$serv-\u003esend($fd, \"hello world\");\n```\n\n## Install from source\n\n```shell\ngit clone git@github.com:huanghantao/tinyswoole.git \u0026\u0026 \\\ncd tinyswoole \u0026\u0026 \\\nphpize \u0026\u0026 \\\n./configure \u0026\u0026 \\\nmake \u0026\u0026 make install\n```\n\n## Welcome\n\nQQ group：942858122","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuanghantao%2Ftinyswoole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuanghantao%2Ftinyswoole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuanghantao%2Ftinyswoole/lists"}