Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import io.reactivex.Observable;
import io.reactivex.subjects.PublishSubject;
import io.reactivex.subjects.Subject;
* Build followed with
* Created by ninja on 6/21/17.
public class RxBus {
private static RxBus instance = new RxBus();
public static RxBus getInstance() {
return instance;
private final Subject<Object> _bus = PublishSubject.create().toSerialized();
public void send(Object event) {
public Observable<Object> toObserverable() {
return _bus;
public boolean hasObservers() {
return _bus.hasObservers();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment