FAQ Database Discussion Community


SAPUI5 EventBus: Prevent stacking the same subsciptions

javascript,sapui5,event-bus,openui5
When i click a button, i want to subscribe to an event EventBus.subscribe("sChannelFoo", "sIdBar", function(){ alert("FOOBAR!"); }); I subscribe on "sChannelFoo" and sIdBar" throughout my code. What is a neat solution to make sure that I subscribe to this event only once with this button, even if I click my...

vertx access event bus outside verticle class

java,vert.x,event-bus
I'm playing around with vert.x event bus, and everything is working fine in the simplest of examples. However I would like to send messages to the vert.x event bus outside the Verticle class. How do I access the event bus from outside the Verticle class? Can Guice be utilised to...

Is using event library like Otto or EventBus a recommended way to handle relations between Activities, Fragments, and background threads

android,android-asynctask,event-bus,otto,greenrobot-eventbus
In most of the case, when dealing with case User thread (AsyncTask) to perform background processing Pass back calculated result back to Activity or Fragment Activity or Fragment re-creation might happen before user thread finishes its background processing So far, from many reliable sources, I can see the recommended way...

EventBus vs Callbacks, which to use when?

android,callback,event-bus
I have many Activities which raise background tasks; the Activities will pass themselves in as having implemented a listener callback, so that the background tasks can raise an event on the Activities. The Activities in turn can show something on the UI to indicate that a background activity passed or...

Akka messaging mechanisms by example

routing,akka,dispatcher,event-bus
I have a fair amount of Apache Camel (routing/mediation/orchestation engine; lightweight ESB) experience and am racking my brain trying to understand the difference between Akka: Dispatchers (Dispatcher, PinnedDispatcher, CallingThreadDispatcher) Routers Pools Groups Event Buses According to the docs: Dispatchers are: ...is what makes Akka Actors “tick”, it is the engine...

Is an event bus unregister necessary

android,memory-leaks,event-bus
I'm implementing MVP pattern in Android and I'm using EventBus to let know the Presenter from activity "A" that something happen at activity "B" to update views from "A". I registered the presenter to EventBus inside in constructor but I don't see any place where I could unregister it. public...

Refreshing multiple Realm instances at once?

java,android,multithreading,realm,event-bus
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...

EventBus and Swing JFrame Garbage Collection?

java,swing,garbage-collection,guava,event-bus
I am refactoring a Swing application to use Guava's EventBus pretty heavily. The Swing application basically runs a decision process, displays a large collection of results in a JFrame, and then gets disposed once the JFrame is closed. Now it also subscribes to an EventBus to handle user manipulation of...