{"id":13699919,"url":"https://github.com/mix-php/sync-invoke","last_synced_at":"2025-04-12T23:32:51.573Z","repository":{"id":57017797,"uuid":"224160378","full_name":"mix-php/sync-invoke","owner":"mix-php","description":"Swoole synchronous blocking code invoke library","archived":false,"fork":false,"pushed_at":"2020-10-28T04:25:57.000Z","size":64,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T17:41:58.397Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","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/mix-php.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":"2019-11-26T10:08:15.000Z","updated_at":"2024-12-16T14:56:34.000Z","dependencies_parsed_at":"2022-08-22T11:31:39.911Z","dependency_job_id":null,"html_url":"https://github.com/mix-php/sync-invoke","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mix-php%2Fsync-invoke","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mix-php%2Fsync-invoke/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mix-php%2Fsync-invoke/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mix-php%2Fsync-invoke/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mix-php","download_url":"https://codeload.github.com/mix-php/sync-invoke/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647257,"owners_count":21139081,"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":[],"created_at":"2024-08-02T20:00:45.825Z","updated_at":"2025-04-12T23:32:51.556Z","avatar_url":"https://github.com/mix-php.png","language":"PHP","funding_links":[],"categories":["Miscellaneous"],"sub_categories":[],"readme":"## Mix Sync Invoke\n\nSwoole 同步阻塞代码调用库，用于执行无法被 Swoole Hook 协程化的同步阻塞代码\n\n## Usage\n\n- 安装\n\n```\ncomposer require mix/sync-invoke\n```\n\n- Server\n\n创建服务器，用于执行同步代码，第二个参数为 `true` 可复用端口\n\n```\n$server = new \\Mix\\SyncInvoke\\Server(9505, true);\n$server-\u003estart();\n```\n\n- Client\n\n```\n$dialer = new \\Mix\\SyncInvoke\\Client\\Dialer();\n$client = $dialer-\u003edial(9505);\n$data   = $client-\u003einvoke(function () {\n    $obj = new Hello();\n    return [1, 2, 3, $obj];\n});\nvar_dump($data);\n```\n\n## License\n\nApache License Version 2.0, http://www.apache.org/licenses/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmix-php%2Fsync-invoke","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmix-php%2Fsync-invoke","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmix-php%2Fsync-invoke/lists"}