{"id":17977959,"url":"https://github.com/coderyi/eventbus","last_synced_at":"2025-10-05T18:19:19.655Z","repository":{"id":90803680,"uuid":"148748764","full_name":"coderyi/EventBus","owner":"coderyi","description":"A lightweight event bus for C++","archived":false,"fork":false,"pushed_at":"2018-09-14T07:03:59.000Z","size":5,"stargazers_count":16,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T05:42:07.574Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","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/coderyi.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-14T07:00:20.000Z","updated_at":"2025-02-19T23:06:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"de8154b6-93f5-4199-b4f4-8687816f6616","html_url":"https://github.com/coderyi/EventBus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/coderyi/EventBus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderyi%2FEventBus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderyi%2FEventBus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderyi%2FEventBus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderyi%2FEventBus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderyi","download_url":"https://codeload.github.com/coderyi/EventBus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderyi%2FEventBus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278495723,"owners_count":25996655,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-29T17:30:18.425Z","updated_at":"2025-10-05T18:19:19.624Z","avatar_url":"https://github.com/coderyi.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"EventBus是一种发布/订阅模式的框架，主要用于解耦。可以看一下[greenrobot](https://github.com/greenrobot/EventBus)的图\n\n\u003cbr/\u003e\n\u003cimg src=\"https://github.com/greenrobot/EventBus/raw/master/EventBus-Publish-Subscribe.png\" width=\"500\" height=\"187\"/\u003e\n\nEventBus的优点是基本没有依赖关系，module间通信只需要知道事件名字就可以，是我个人比较推荐的。\n\n示例\n\n```\n#include \"EventBus.h\"\n#include \u003ciostream\u003e\n\nvoid    foo(EventBus::BaseMessage *i)\n{\n\tEventBus::Message\u003cstd::string\u003e  *j = static_cast\u003cEventBus::Message\u003cstd::string\u003e*\u003e(i);\n\n\tstd::cout\u003c\u003c*j-\u003egetData() \u003c\u003c std::endl;\n}\n\nint main()\n{\n\tEventBus::Bus   b;\n\tb.addListener(\"hello\", foo);\n\tdelete b.sendMessage(new EventBus::Message\u003cstd::string\u003e(\"hello\", new std::string(\"Hello world !\")));\n\treturn 0;\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderyi%2Feventbus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderyi%2Feventbus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderyi%2Feventbus/lists"}