-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Closed
Description
I'm a little confused about takeLast(long, TimeUnit).
When executing the following code, each time the output order is supposed to be N digits in the last time window, but in fact the output results are inconsistent with the ideal state.
Code
public static void main(String[] args) {
ArrayList<Integer> ints = new ArrayList<>();
for (int i = 0; i < 100; i++) {
ints.add(i);
}
Observable.fromIterable(ints)
.takeLast(1,TimeUnit.NANOSECONDS)
.subscribe(longs->{
System.out.println(longs);
});
try {
Thread.sleep(100000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}