{"id":19012911,"url":"https://github.com/bq/autobus","last_synced_at":"2025-04-22T23:45:35.800Z","repository":{"id":30792508,"uuid":"34349523","full_name":"bq/autobus","owner":"bq","description":"An enhanced event bus for Android projects","archived":false,"fork":false,"pushed_at":"2016-05-19T14:41:23.000Z","size":145,"stargazers_count":22,"open_issues_count":0,"forks_count":8,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-17T16:04:23.734Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://bq.github.io/autobus","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/bq.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":"2015-04-21T20:06:15.000Z","updated_at":"2023-12-12T16:03:22.000Z","dependencies_parsed_at":"2022-08-18T22:24:59.187Z","dependency_job_id":null,"html_url":"https://github.com/bq/autobus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bq%2Fautobus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bq%2Fautobus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bq%2Fautobus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bq%2Fautobus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bq","download_url":"https://codeload.github.com/bq/autobus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250343865,"owners_count":21415035,"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-11-08T19:20:34.784Z","updated_at":"2025-04-22T23:45:35.778Z","avatar_url":"https://github.com/bq.png","language":"Java","funding_links":[],"categories":["进程间通信"],"sub_categories":["微服务框架"],"readme":" __Autobus__ \u003cbr/\u003eAn event bus by __BQ__\n======================================\n\n![alt text](https://raw.githubusercontent.com/bq/autobus/master/autobus_logo.png \"Autobus logo\")\n\nWhat?\n------------------------------\nAn enhanced event bus intended to allow communication between decoupled parts of an application.\n\nIt is based on concepts from [Otto][1], [EventBus][2] and [RxJava][3].\n\n**For usage instructions please see [Autobus website][4].**\n\n\nWhy?\n------------------------------\nWe developed our own Event Bus to cover two main needs that aren't covered by existing libraries:\n\n* __Decouple channels and emitted data__\n\nBoth Otto and EventBus use Events (defined classes) to carry data and also to represent the channel the subscribers\nare listening to. This approach is valid but it is quite inflexible. \n\nAutobus allows representing channels as Strings and\ndata as a separate class; this way a subscriber can listen to a channel expecting a concrete class of data (or even Any class\nof data) and emitters can send data of a concrete class (or no data at all) to a concrete channel. When an emitter sends data of\nclass D to a channel C, every subscriber listening to channel C and expecting data of class D is notified. Also subscribers\nlistening to channel C and expecting data of any class are notified.\n\n* __Explicit contract between subscribers and emitters__\n\nAs one of the common use case of Event Buses is the communication between _interactors_ (asynchronous core operations of an app) and _presenters_ (adapters between _views_ and _interactors_) it is desirable to maintain an explicit definition or contract between the emitters and the subscribers. Autobus accomplishes this task with BusObservable API. A _interactor_ can return a BusObservable instance and subscribers can directly be subscribed to this observable; the observable is the contract itself as it defines the _Bus_, the _Channel_ and also the data that will be emitted. \n\n\nOk, what else?\n------------------------------\n* Full annotated with @Nullable and @NotNull.\n* Clean code enforcement by strong typing. No need for upcasting/downcasting any object.\n* Autocomplete heaven (related to this string typing).\n\n\nComparison\n----------\n| Functionality                   | EventBus        | Otto        | Autobus                           |\n| --------------------------------|-----------------|-------------|---------------------------------- |\n| Declare event handling methods  | Name Convention | Annotations | Explicity                         |\n| Event inheritance               | Yes             | Yes         | No                                |\n| Cache most recent events        | Yes (sticky)    | No          | Yes (persistent emmit)            |\n| Event producers                 | No              | Yes         | No                                |\n| Event delivery in posting thread| Yes             | Yes         | Yes                               |\n| Event delivery in main thread   | Yes             | No          | Yes (using preprocessor)          |\n| Event delivery in bg thread     | Yes             | No          | Yes                               |\n| Aynchronous event delivery      | Yes             | No          | Yes                               |\n\n\nDownload\n--------\n\nAutobus is available on Maven Central. Please ensure that you are using the latest version by checking [here][5]. \n\n**Maven**:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.bq\u003c/groupId\u003e\n  \u003cartifactId\u003eautobus\u003c/artifactId\u003e\n  \u003cversion\u003e0.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\nor **Gradle**:\n```groovy\ncompile 'com.bq:autobus:0.1.0'\n```\n\nSnapshots of the development version are available in [Sonatype's `snapshots` repository][snap].\n\nLicense\n-------\nThis project is licensed under the Apache Software License, Version 2.0.\n\n    Copyright (c) 2015 BQ\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n [1]: http://square.github.com/otto/\n [2]: https://github.com/greenrobot/EventBus\n [3]: https://github.com/ReactiveX/RxJava\n [4]: http://opensource.bq.com/autobus/\n [5]: http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.bq%22%20AND%20a%3A%22autobus%22\n [snap]: https://oss.sonatype.org/content/repositories/snapshots/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbq%2Fautobus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbq%2Fautobus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbq%2Fautobus/lists"}