{"id":29829174,"url":"https://github.com/beapp/beapp.library.bus.android","last_synced_at":"2025-09-26T16:13:24.724Z","repository":{"id":92923286,"uuid":"235578914","full_name":"BeApp/beapp.library.bus.android","owner":"BeApp","description":"This library provides classic and sorted bus mechanism based on Rx","archived":false,"fork":false,"pushed_at":"2020-02-21T14:02:30.000Z","size":76,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-07-29T08:42:08.036Z","etag":null,"topics":["android","bus","rx"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BeApp.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-01-22T13:26:03.000Z","updated_at":"2020-02-21T14:02:32.000Z","dependencies_parsed_at":"2023-08-23T17:16:03.319Z","dependency_job_id":null,"html_url":"https://github.com/BeApp/beapp.library.bus.android","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/BeApp/beapp.library.bus.android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeApp%2Fbeapp.library.bus.android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeApp%2Fbeapp.library.bus.android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeApp%2Fbeapp.library.bus.android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeApp%2Fbeapp.library.bus.android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BeApp","download_url":"https://codeload.github.com/BeApp/beapp.library.bus.android/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeApp%2Fbeapp.library.bus.android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272063233,"owners_count":24866678,"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-25T02:00:12.092Z","response_time":1107,"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":["android","bus","rx"],"created_at":"2025-07-29T08:15:28.194Z","updated_at":"2025-09-26T16:13:19.416Z","avatar_url":"https://github.com/BeApp.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"This library provides two bus mechanism :\n\n1. `RxBus` : A simple one based on [RxJava](https://github.com/ReactiveX/RxJava)\n2. `SortedBus` : A bus with priorities on each listened event and the ability for listeners to consume the event \n\n# Usage\n\nFor both implementation, we first have to define events :\n\n```java\npublic class MessageEvent { /* Additional fields if needed */ }\n```\n\nThen, two steps are needed, according to the implementation used.\n\n## RxBus\n\n1. Register subscriber for a given event\n\n```java\nRxBus.getInstance().register(MessageEvent.class)\n    .subscribe(event -\u003e ...,\n        throwable -\u003e ...);\n```\n\n1. Post events\n\n```java\nRxBus.getInstance().send(new MessageEvent());\n```\n\n## SortedBus\n\n1. Register subscriber for a given event with a priority\n\n```java\nSortedBus.getInstance().register(MessageEvent.class, SortedBus.PRIORITY_MEDIUM, new Executor\u003cMessageEvent\u003e() {\n    @Override\n    public boolean execute(MessageEvent event) {\n        return false;   // Return true if you want to stop this event's propagation to other subscribers. False otherwise\n    }\n});\n```\n\n2. Post events\n\n```java\nSortedBus.getInstance().send(new MessageEvent());\n```\n\n# Installation\n\nAdd jcenter's repository in your project's repositories list, then add the dependency.\n\n```groovy\nrepositories {\n    jcenter()\n}\n\ndependencies {\n    implementation 'fr.beapp.bus:bus:\u003clatest-release\u003e'\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeapp%2Fbeapp.library.bus.android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeapp%2Fbeapp.library.bus.android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeapp%2Fbeapp.library.bus.android/lists"}