Question: I would like to use the [Fetch API](https://developer.mozilla.org/en/docs/Web/API/Fetch_API) in a browser extension to download a resource and compute a hash thereof. The following works (using [crypto](https://nodejs.org/api/crypto.html) through [Browserify](http://browserify.org/))

```
fetch(url).then(function(response) {
  return response.blob();
}).then(function(data) {
  var a = new FileReader();
  a.readAsBinaryString(data);
  a.onloadend = function() {
    var hash = crypto.createHash(hashType);
    hash.update(a.result, 'binary');
    return hash.digest('hex');
  };
})

```

but has the disadvantage that I have to wait for `a.onloadend` while the context in which I'd like to embed it requires a `Promise` to be returned. Also, it seems quite weird to first fetch the entire blob, then read it into a `FileReader` just to dump it into `createHash` afterwards.

Any hints?

Answer: 
Technically, yes the observable needs to register itself with the EventBus, that's why it's never receiving the ReceiverEvent. But registering an anonymous class with the event bus is messy at best. The bigger problem is with your architecture.

RxJava, EventBus and Observable's are all tools that solve the same problem. They all implement more or less the same trick - the observable pattern. The difference is that EventBus and RxJava provide more features - mostly around the elegancy of the code - they make the code more readable and therefore faster to implement.

So in your case, I would suggest choosing one - RxJava or EventBus. There is no need to use both.

At the moment - it looks like you are using the Receiver to listen for something in the c++ code, then using the EventBus to pass that message on to an RxJava Observable, who then passes it on to whatever is observing. Why not cut out one or more of the middlemen? Make the Receiver an Observable class, or remove the observable altogether and just listen for the ReceivedEvent in which ever part of your app really needs it...
You can use `PublishSubject`. It's observable and observer simultaneously.
You can push events and subscribe to it same time.

```
PublishSubject<ReceiverEvent> channel = PublishSubject.create();
channel.subscribe(yourObserver);

```

In green robot receiver

```
public void onEvent(ReceiverEvent receiverEvent) {
    channel.onNext(receiverEvent);
}

```

You can use EventBus implemented in Rx instead GreenRobot:  

Here example from author of Rx - [gist](https://gist.github.com/benjchristensen/04eef9ca0851f3a5d7bf)