{"id":21880506,"url":"https://github.com/brucewind/rxbroadcaster","last_synced_at":"2026-05-10T16:17:17.143Z","repository":{"id":92556184,"uuid":"68588370","full_name":"BruceWind/RxBroadcaster","owner":"BruceWind","description":"使用RxJava实现Broadcaster ","archived":false,"fork":false,"pushed_at":"2016-10-10T07:33:49.000Z","size":106,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-29T10:41:47.383Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/BruceWind.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-19T09:05:04.000Z","updated_at":"2016-12-04T05:29:16.000Z","dependencies_parsed_at":"2023-03-03T13:00:39.155Z","dependency_job_id":null,"html_url":"https://github.com/BruceWind/RxBroadcaster","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BruceWind/RxBroadcaster","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BruceWind%2FRxBroadcaster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BruceWind%2FRxBroadcaster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BruceWind%2FRxBroadcaster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BruceWind%2FRxBroadcaster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BruceWind","download_url":"https://codeload.github.com/BruceWind/RxBroadcaster/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BruceWind%2FRxBroadcaster/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270796219,"owners_count":24647319,"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-08-16T02:00:11.002Z","response_time":91,"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-11-28T09:14:14.616Z","updated_at":"2026-05-10T16:17:12.103Z","avatar_url":"https://github.com/BruceWind.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RxBroadcaster \n\n\n## 使用RxJava实现Broadcaster \n\n由于广播本身存在性能问题，所以我们一直使用一种方案就是V4包下面的LocalBroadcastManger去发送广播，这使用handler实现的，性能极高。\n但是由于无法自由的切换线程,所以这就是这个库出现的意义。\n\n## 使用\n```\nMainActivity extends AppCompatActivity  {\n\n    RxBroadcastReceiver broadcastReceiverAsync = new RxBroadcastReceiver(){\n\n        @SuppressLint(\"LongLogTag\")\n        @Override\n        public void onReceive(Context context, Intent intent) {\n\n            Log.d(\"RxLocalBroadcastManager send:\", intent.getAction()+ \" ,onReceive is MainThraed=\" + isMainTread());\n        }\n    };\n    \n        @Override\n        protected void onCreate(Bundle savedInstanceState) {\n    \n            super.onCreate(savedInstanceState);\n\n            IntentFilter filters=new IntentFilter();\n            filters.addAction(\"testthread\");\n            RxLocalBroadcastManager.getInstance(this).registerReceiver(broadcastReceiverAsync,filters);\n            \n        }\n\n\n...\n...\n\n}\n    \n//log如下 ：\n\nRxBroadCastManager send:: testthread ,onReceive is MainThraed=true\nRxBroadCastManager send:: testthread ,onReceive is MainThraed=false\n\n\n```\n\n## 特性\n\n1. 高度的线程切换的自由\n\n2. 像LocalBroadcastManger一样的高性能\n\n3. 解决广播使用过程中多次注册带来的 接受两次的bug\n\n\n## 注意\n\n1. RxBroadCastReceiver跟官方不同点在于这里没有切换线程，而使用LocalBoradCastManger的时候，就会在UI线程OnReceive，\n所以这里需要注意，需要非要回到UI线程使用 RxBroadCastReceiverMainThread.\n\n2. register之后记得要unRegister,否则容易导致内存泄露因为这是强引用.\n\n\n\n## 测试日志　\n\n1. 测试发现 多次 commit 都没有收到多条 解决 使用　LocalBroadCastManager　时带来的问题\n\n2. 测试中没有发现　同步 remove　和 add 带来的异常\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrucewind%2Frxbroadcaster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrucewind%2Frxbroadcaster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrucewind%2Frxbroadcaster/lists"}