Skip to content

Instantly share code, notes, and snippets.

@SeongUgJung
Created March 1, 2015 03:48
Show Gist options
  • Save SeongUgJung/60dc45f96ae521c043fe to your computer and use it in GitHub Desktop.
Save SeongUgJung/60dc45f96ae521c043fe to your computer and use it in GitHub Desktop.
publishSubject = PublishSubject.create();
messageSubscription = publishSubject.observeOn(Schedulers.io())
.subscribe(loadType -> {
switch (loadType) {
case Saved:
getSavedMessageList();
break;
case Old:
getOldMessageList(messageState.getFirstItemId());
messageListModel.trackGetOldMessage(entityType);
break;
case New:
getNewMessageList(messageState.getLastUpdateLinkId());
break;
}
}, throwable -> {
}, () -> {
});
publishSubject.onNext(LoadType.Old);
publishSubject.onNext(LoadType.New);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment