Skip to content

Commit 6f963cd

Browse files
authored
Merge pull request #3 from ultraon/ultraon-patch-3
Fixed result output
2 parents 0feddc1 + a4cc48d commit 6f963cd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/java/itrx/chapter3/hotandcold/MulticastExample.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void exampleMutlicast() throws InterruptedException {
4646
Thread.sleep(500);
4747
Subscription s2 = cold.subscribe(i -> System.out.println("Second: " + i));
4848
Thread.sleep(500);
49-
System.out.println("Unsubscribe first");
49+
System.out.println("Unsubscribe second");
5050
s2.unsubscribe();
5151
Thread.sleep(500);
5252
System.out.println("Unsubscribe first");
@@ -55,15 +55,19 @@ public void exampleMutlicast() throws InterruptedException {
5555
System.out.println("First connection again");
5656
Thread.sleep(500);
5757
s1 = cold.subscribe(i -> System.out.println("First: " + i));
58+
Thread.sleep(900);
59+
System.out.println("Unsubscribe first again");
60+
s1.unsubscribe();
5861

5962
// First: 0
6063
// First: 1
6164
// First: 2
6265
// Second: 2
6366
// First: 3
6467
// Second: 3
65-
// Unsubscribe first
6668
// First: 4
69+
// Second: 4
70+
// Unsubscribe second
6771
// First: 5
6872
// First: 6
6973
// Unsubscribe first
@@ -72,7 +76,7 @@ public void exampleMutlicast() throws InterruptedException {
7276
// First: 1
7377
// First: 2
7478
// First: 3
75-
// First: 4
79+
// Unsubscribe first again
7680
}
7781

7882

0 commit comments

Comments
 (0)