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 @@ -114,7 +114,7 @@ public void exampleRefcount() throws InterruptedException {
114114 Thread .sleep (500 );
115115 Subscription s2 = cold .subscribe (i -> System .out .println ("Second: " + i ));
116116 Thread .sleep (500 );
117- System .out .println ("Unsubscribe first " );
117+ System .out .println ("Unsubscribe second " );
118118 s2 .unsubscribe ();
119119 Thread .sleep (500 );
120120 System .out .println ("Unsubscribe first" );
@@ -123,15 +123,19 @@ public void exampleRefcount() throws InterruptedException {
123123 System .out .println ("First connection again" );
124124 Thread .sleep (500 );
125125 s1 = cold .subscribe (i -> System .out .println ("First: " + i ));
126+ Thread .sleep (900 );
127+ System .out .println ("Unsubscribe first again" );
128+ s1 .unsubscribe ();
126129
127130 // First: 0
128131 // First: 1
129132 // First: 2
130133 // Second: 2
131134 // First: 3
132135 // Second: 3
133- // Unsubscribe first
134136 // First: 4
137+ // Second: 4
138+ // Unsubscribe second
135139 // First: 5
136140 // First: 6
137141 // Unsubscribe first
@@ -140,7 +144,7 @@ public void exampleRefcount() throws InterruptedException {
140144 // First: 1
141145 // First: 2
142146 // First: 3
143- // First: 4
147+ // Unsubscribe first again
144148 }
145149
146150
You can’t perform that action at this time.
0 commit comments