event-bus

What is the difference between EventBus and RxJava? [duplicate]

♀尐吖头ヾ 提交于 2019-12-02 15:44:06
This question already has an answer here: Android Pros & Cons: Event Bus and RxJava 1 answer I am confused about the difference between EventBus and RxJava in android. I need to implement one of them for my issue about notifying some components when some changes have been done, so that they can update their state. Also, I read that EventsBus has became deprecated over RxJava and I don't know if this information is true or not. Vesko EventBus and RxJava are different in their nature. EventBus is just a bus as the name suggest - it provides the mechanism to subscribe and publish events to the

Fragment Callbacks vs EventBus in Android

谁都会走 提交于 2019-12-01 09:44:04
I have faced with the problem. My Activity is fragment container, so to communicate between activity and fragments I used common Callback approach. In this case my activity has to implement tons of callback interfaces depending on fragment count. I don't like to hardcode and unreadable code. In my case my class declaration can take several lines to list all interfaces. I am trying to get rid of this. There is another approach is to use EventBus pattern. In activity EventBus.getDefault().register(this); In fragment EventBus.getDetault().post(new MyEvent(description)); And handle several event

Android Pros & Cons: Event Bus and RxJava

馋奶兔 提交于 2019-11-30 03:39:01
I have been using Event Bus in my apps (i.e: greenrobot/EventBus). But I find some disadvantages in using Event Bus: Chaining tasks execution is difficult A lot of classes to represent events Less clear code (well, it's still possible to trace, but not as clear) I have been researching for new techniques to deal with this problem. And I read quite a bit about RxJava and wonder if it could be a solution. So my questions about RxJava (based on what I have read recently): Could RxJava observer be registered at any time? So not just when creating the Observable. With EventBus this is possible, I

EventBus/PubSub vs (reactive extensions) RX with respect to code clarity in a single threaded application

此生再无相见时 提交于 2019-11-29 19:52:13
Currently, I am using an EventBus/ PubSub architecture/pattern with Scala (and JavaFX) to implement a simple note organizing app (sort of like an Evernote client with some added mind mapping functionality) and I have to say that I really like EventBus over the observer pattern. Here are some EventBus libraries : https://code.google.com/p/guava-libraries/wiki/EventBusExplained http://eventbus.org (currently seems to be down) this is the one I am using in my implementation. http://greenrobot.github.io/EventBus/ Here is a comparison of EventBus libraries : http://codeblock.engio.net/37/ EventBus

Refreshing multiple Realm instances at once?

落花浮王杯 提交于 2019-11-29 15:34:01
I'm using a setup in which every Presenter that is a retained Fragment has its own Realm instance. However, this essentially means that these Realms are all on the main thread. Now that also means, if I want to modify the Realm, I either need to do that on the main thread (which is okay for small data sets, but I don't really want to do that with large data sets), or I need to do it on a background thread, and refresh every Realm instance at once (which is possible with a simple event to the event bus). public enum SingletonBus { INSTANCE; private static String TAG = SingletonBus.class

How do I configure Vert.x event bus to work across cluster of Docker containers?

两盒软妹~` 提交于 2019-11-29 09:54:42
问题 In my current setup, I'm using the default multicast option of the Hazelcast cluster manager. When I link the instances of my containerized Vertx modules (via Docker networking links), I can see that they are successfully creating Hazelcast cluster. However, when I try publishing events on the event bus from one module, the other module doesn't react to it. I'm not sure how the network settings in the Hazelcast cluster related to the network settings for the event bus. At the moment, I have

Refreshing multiple Realm instances at once?

▼魔方 西西 提交于 2019-11-28 09:58:14
问题 I'm using a setup in which every Presenter that is a retained Fragment has its own Realm instance. However, this essentially means that these Realms are all on the main thread. Now that also means, if I want to modify the Realm, I either need to do that on the main thread (which is okay for small data sets, but I don't really want to do that with large data sets), or I need to do it on a background thread, and refresh every Realm instance at once (which is possible with a simple event to the