X Tutup
Skip to content

Commit 63a52fc

Browse files
committed
Simplified window example
1 parent cbd3a61 commit 63a52fc

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

Part 4 - Concurrency/3. Sequences of coincidence.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,22 @@ Observable
3030
.merge(
3131
Observable.range(0, 5)
3232
.window(3,1))
33-
.subscribe(new PrintSubscriber("Window"));
33+
.subscribe(System.out::println);
3434
```
3535
Output
3636
```
37-
Window: 0
38-
Window: 1
39-
Window: 1
40-
Window: 2
41-
Window: 2
42-
Window: 2
43-
Window: 3
44-
Window: 3
45-
Window: 3
46-
Window: 4
47-
Window: 4
48-
Window: 4
49-
Window: Completed
37+
0
38+
1
39+
1
40+
2
41+
2
42+
2
43+
3
44+
3
45+
3
46+
4
47+
4
48+
4
5049
```
5150

5251
We can see here that the inner observables are emitting the same value simultaneously, if that value belongs to multiple windows.

0 commit comments

Comments
 (0)
X Tutup