title: EventBus/PubSub vs (reactive extensions) RX with respect to code clarity in a single threaded application
body: <p>Currently, I am using an EventBus/<a href="http://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern" rel="noreferrer">PubSub</a> 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. </p>
  
  <p>Here are some EventBus libraries : </p>
  
  <p><a href="https://code.google.com/p/guava-libraries/wiki/EventBusExplained" rel="noreferrer">https://code.google.com/p/guava-libraries/wiki/EventBusExplained</a></p>
  
  <p><a href="http://eventbus.org" rel="noreferrer">http://eventbus.org</a> (currently seems to be down) this is the one I am using in my implementation.</p>
  
  <p><a href="http://greenrobot.github.io/EventBus/" rel="noreferrer">http://greenrobot.github.io/EventBus/</a></p>
  
  <p>Here is a comparison of EventBus libraries : <a href="http://codeblock.engio.net/37/" rel="noreferrer">http://codeblock.engio.net/37/</a> </p>
  
  <p>EventBus is related to the <a href="http://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern" rel="noreferrer">publish-subscribe pattern</a>.</p>
  
  <p><strong>However !</strong></p>
  
  <p>Recently, I took the <a href="https://www.coursera.org/course/reactive" rel="noreferrer">Reactive course by Coursera</a> and started to wonder whether using <a href="https://github.com/Netflix/RxJava" rel="noreferrer">RXJava</a> instead of EventBus would simplify the event handling code even more in a <strong>single threaded</strong> application ?</p>
  
  <p>I would like to ask about the experiences of people who programmed using both technologies (some kind of eventbus library <strong>and</strong> some form of the <a href="https://rx.codeplex.com" rel="noreferrer">reactive extensions</a> (RX)): was it easier to tackle event handling complexity using RX than with an event bus architecture <strong>given that there was no need to use multiple threads</strong> ? </p>
  
  <p>I am asking this because I have heard in the <a href="https://www.coursera.org/course/reactive" rel="noreferrer">Reactive Lectures on Coursera</a> that <a href="https://rx.codeplex.com" rel="noreferrer">RX</a> leads to much cleaner code than using the observer pattern (i.e. there is no "callback hell"), however I did not find any comparison between EventBus architecture vs <a href="https://github.com/Netflix/RxJava" rel="noreferrer">RXJava</a>. So it's clear that both EventBus and RXJava are better than the observer pattern but <strong>which is better in a single threaded applications</strong>  in terms of code clarity and maintainability ?</p>
  
  <p>If I understand correctly the main selling point of <a href="https://github.com/Netflix/RxJava" rel="noreferrer">RXJava</a> is that it can be used to produce responsive applications if there are blocking operations (e.g. waiting for response from a server).</p>
  
  <p>But I don't care about asychronicity at all, all I care about is keeping the code clean, untangled and easy to reason about in a <strong>single threaded application</strong>.</p>
  
  <p>In that case, is it still better to use RXJava than EventBus ? </p>
  
  <p>I think EventBus would be a simpler and cleaner solution and I don't see any reason why I should use RXJava for a <strong>single threaded application</strong> in favour of a simple EventBus architecture. </p>
  
  <p><strong>But I might be wrong!</strong></p>
  
  <p>Please correct me if I am wrong and explain why RXJava would be better than a simple EventBus in case of a <strong>single threaded application</strong> where no blocking operations are carried out.</p>