操作符分类
创建操作
Create, Defer, Empty/Never/Throw, From, Interval, Just, Range, Repeat, Start, Timer
变换操作
Buffer, FlatMap, GroupBy, Map, Scan和Window
过滤操作
Debounce, Distinct, ElementAt, Filter, First, IgnoreElements, Last, Sample, Skip, SkipLast, Take, TakeLast
组合操作
And/Then/When, CombineLatest, Join, Merge, StartWith, Switch, Zip
错误处理
Catch和Retry
辅助操作
Delay, Do, Materialize/Dematerialize, ObserveOn, Serialize, Subscribe, SubscribeOn, TimeInterval, Timeout,
Timestamp, Using
条件和布尔操作
All, Amb, Contains, DefaultIfEmpty, SequenceEqual, SkipUntil, SkipWhile, TakeUntil, TakeWhile
算术和集合操作
Average, Concat, Count, Max, Min, Reduce, Sum
转换操作
To
连接操作
Connect, Publish, RefCount, Replay
反压操作,用于增加特殊的流程控制策略的操作符
Scheduler
如果你想给Observable操作符链添加多线程功能,你可以指定操作符(或者特定的Observable)在特定的调度器(Scheduler)上执行
调度器的种类
Schedulers.computation( )
用于计算任务,如事件循环或和回调处理,不要用于IO操作(IO操作请使用Schedulers.io());默认线程数等于处理器的数量
Schedulers.from(executor)
使用指定的Executor作为调度器
Schedulers.immediate( )
在当前线程立即开始执行任务
Schedulers.io( )
用于IO密集型任务,如异步阻塞IO操作,这个调度器的线程池会根据需要增长;对于普通的计算任务,请使用Schedulers.computation();Schedulers.io( )默认是一个CachedThreadScheduler,很像一个有线程缓存的新线程调度器
Schedulers.newThread( )
为每个任务创建一个新线程
Schedulers.trampoline( )
当其它排队的任务完成后,在当前线程排队开始执行
默认调度器
buffer(timespan)
computation
buffer(timespan, count)
computation
buffer(timespan, timeshift)
computation
debounce(timeout, unit)
computation
delay(delay, unit)
computation
delaySubscription(delay, unit)
computation
interval
computation
repeat
trampoline
replay(time, unit)
computation
replay(buffersize, time, unit)
computation
replay(selector, time, unit)
computation
replay(selector, buffersize, time, unit)
computation
retry
trampoline
sample(period, unit)
computation
skip(time, unit)
computation
skipLast(time, unit)
computation
take(time, unit)
computation
takeLast(time, unit)
computation
takeLast(count, time, unit)
computation
takeLastBuffer(time, unit)
computation
takeLastBuffer(count, time, unit)
computation
throttleFirst
computation
throttleLast
computation
throttleWithTimeout
computation
timeInterval
immediate
timeout(timeoutSelector)
immediate
timeout(firstTimeoutSelector, timeoutSelector)
immediate
timeout(timeoutSelector, other)
immediate
timeout(timeout, timeUnit)
computation
timeout(firstTimeoutSelector, timeoutSelector, other)
immediate
timeout(timeout, timeUnit, other)
computation
timer
computation
timestamp
immediate
window(timespan)
computation
window(timespan, count)
computation
window(timespan, timeshift)
computation
本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!