Trong trường hợp nào tôi nên sử dụng doOnNext, và trong trường hợp nào doOnEach?RxJava: sự khác biệt giữa doOnNext và doOnEach
.doOnEach(new Action1<Notification<? super MessageProfile>>() {
@Override
public void call(Notification<? super MessageProfile> notification) {
}
})
.doOnNext(new Action1<MessageProfile>() {
@Override
public void call(MessageProfile profile) {
messageProfileDao.save(profile);
}
})
Có vẻ như cả hai nhà khai thác đều có cùng tác dụng.