File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
tests/java/itrx/chapter3/hotandcold Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments