Assume that I have following.
Observable.range(1,1000)
.flatMap(i -> Observable.just(i)
.subscribeOn(Schedulers.computation()
.map(i2 -> calculate(i2))
).subscribe(System.out::println)
In here I have an observable from 1 to 1000 and each number is mapped using calculate()(a large mehod) in different threads.I need to set a timeout until some amount of items returned.
How can I do this using Rx Java?
这可以使用rx-java中的buffer()而不是使用timeout()来实现
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.