event-bus

Android, notify backstack fragments on some change

戏子无情 提交于 2019-12-11 08:53:49
问题 What is the best practice to notify all the fragments that are in backstack on some change? I try to use EventBus and every Fragment subscribe to the event, then when change is happening the main activity send post event to all the subscribers. Only onDestroy I Unsubscribe the destroyed fragment. I don't like this solution because if there are many fragments in backstack, it can be heavy + lots of listeners simultany. my application, has infinity drill down, from one fragment you replace to

In RabbitMQ which is more expensive, multiple queues per exchange, or multiple exchanges and less queues per each?

隐身守侯 提交于 2019-12-10 12:35:30
问题 So we decided to go with RabbitMQ as a message/event bus in our migration to micro-services architecture, but we couldn't find a definite answer on what is the best way of putting our queues, we have two options to go with: One main exchange which will be a Fanout exchange, which in turn will fan messages out to a main queue for logging and other purposes and another sub exchange which will be a topic exchange and route the messages to each desired queue using the message routing key. We

How to use EventBus for non-Presenter class in GWTP?

邮差的信 提交于 2019-12-10 11:45:17
问题 I am using GWTP platform & eClipse to build webapp. In Eclipse, when creating a Presenter, it will create 3 files (ex: SearchPresenter.java, SearchView.java, & SearchView.ui.xml): public class SearchView extends ViewImpl implements SearchPresenter.MyView public class SearchPresenter extends Presenter<SearchPresenter.MyView, SearchPresenter.MyProxy>{ .... private EventBus eventBus; @Inject public SearchPresenter(final EventBus eventBus, final MyView view) { super(eventBus, view); this.eventBus

Event bus review

限于喜欢 提交于 2019-12-09 07:08:37
问题 I'm starting with GWT and learning Event bus concepts now. I find this solution extremely complicated. So I tried to simplify it by writing prototype by myself to see all problems. At first I will write about my understanding of event bus (that can be completely wrong). We have events like this public class FooEvent extends GwtEvent<FooHandler> { public static Type<FooHandler> TYPE = new Type<FooHandler>(); //as event type integer ID //for.. hm.. probably some inner use in Event Bus @Override

How does eventbus register the onevent method before the class is invoked?

冷暖自知 提交于 2019-12-08 04:04:03
问题 The listItemFragment post an event to the ItemDetailFragment to refresh the UI. BUt the ItemDetailFragment is never used before, so the register() method in ItemDetailFragment is never invoked. So I want to know how the posted event in listItemFragment know the onevent method in ItemDetailFragment. Here is the source code: package com.angeldevil.eventbusdemo; import android.os.Bundle; import android.support.v4.app.ListFragment; import android.view.View; import android.widget.ArrayAdapter;

GWT - MVP Event bus. Multiple handlers getting created

强颜欢笑 提交于 2019-12-07 13:13:24
问题 I am working in a large application I inherited, and am running into some best practices issues. Every time a user navigates to our Customer Edit page, a new presenter is created, and a view is set. There is a main presenter for the customer edit, and a main view. There are also sub views within the main view that are used by sub presenters of the main presenter. Within the sub presenters I register event handlers on the event bus. The issue I'm having is that when a navigates to the contact

How to post a message from a background service to a UI fragment?

自作多情 提交于 2019-12-07 08:15:21
问题 I have an issue with EventBus from Greenrobot. I was trying to post an event from a background service form my sync adapter and catch it in a fragment to update the UI. The problem is that when I try to post the event from sync adapter I have get the following in the debug log: No subscribers registered for event class olexiimuraviov.ua.simplerssreader.event.UpdateUIEvent No subscribers registered for event class org.greenrobot.eventbus.NoSubscriberEvent I register fragment in onResume and

Why Guava eventbus (the module) is not extensible?

 ̄綄美尐妖づ 提交于 2019-12-07 07:43:25
问题 In the latest version (and in the previous versions too), Guava eventbus module is not extensible. Currently, it uses Subscriber and SubscriberRegistry internally to decide on dispatching the event. But these classes are made package-private and hence not extensible. If Subscriber and SubscriberRegistry were made as a public interface, it would let others to provide their own implementation in deciding the Subscriber . Let me explain my usecase to make more sense here. Lets say I have a

Why Guava eventbus (the module) is not extensible?

房东的猫 提交于 2019-12-05 17:44:40
In the latest version (and in the previous versions too), Guava eventbus module is not extensible. Currently, it uses Subscriber and SubscriberRegistry internally to decide on dispatching the event. But these classes are made package-private and hence not extensible. If Subscriber and SubscriberRegistry were made as a public interface, it would let others to provide their own implementation in deciding the Subscriber . Let me explain my usecase to make more sense here. Lets say I have a hierarchy of classes which have a common set of events (create/updated/delete). And there are listeners who

How to post a message from a background service to a UI fragment?

本秂侑毒 提交于 2019-12-05 13:53:27
I have an issue with EventBus from Greenrobot. I was trying to post an event from a background service form my sync adapter and catch it in a fragment to update the UI. The problem is that when I try to post the event from sync adapter I have get the following in the debug log: No subscribers registered for event class olexiimuraviov.ua.simplerssreader.event.UpdateUIEvent No subscribers registered for event class org.greenrobot.eventbus.NoSubscriberEvent I register fragment in onResume and unregister it in onPause @Override public void onResume() { super.onResume(); EventBus.getDefault()