比较简单的作用,玩过数据库的看到这个单词应该也挺眼熟的。...示例用法
Observable.just(1, 2, 1, 1, 2, 3, 4, 6, 4)
// Run on a background thread...notified on the main thread
.observeOn(AndroidSchedulers.mainThread())
.distinct...()//就是去重操作
.subscribe(getObserver());//这里的观察者依然不重要
运行结果
1,2,3,4,6
分析
我们创建了一个会发送1, 2,...1, 1, 2, 3, 4, 6, 4 这些item的被观察者
其中1,2,4都有重复的数字
然后用操作符distinct去掉重复的数字
最后,我们从观察者中拿到的item为1,2,3,4,6
总结