20
20
import rx .Observer ;
21
21
import rx .Subscription ;
22
22
import rx .subscriptions .CompositeSubscription ;
23
- import rx .subscriptions .MultipleAssignmentSubscription ;
23
+ import rx .subscriptions .SerialSubscription ;
24
24
import rx .util .functions .Func1 ;
25
25
26
26
/**
@@ -62,8 +62,7 @@ public Subscription onSubscribe(Observer<? super T> observer) {
62
62
SafeObservableSubscription parent ;
63
63
parent = new SafeObservableSubscription ();
64
64
65
- MultipleAssignmentSubscription child ;
66
- child = new MultipleAssignmentSubscription ();
65
+ SerialSubscription child = new SerialSubscription ();
67
66
68
67
parent .wrap (sequences .subscribe (new SwitchObserver <T >(observer , parent , child )));
69
68
@@ -76,13 +75,13 @@ private static class SwitchObserver<T> implements Observer<Observable<? extends
76
75
private final Object gate ;
77
76
private final Observer <? super T > observer ;
78
77
private final SafeObservableSubscription parent ;
79
- private final MultipleAssignmentSubscription child ;
78
+ private final SerialSubscription child ;
80
79
private long latest ;
81
80
private boolean stopped ;
82
81
private boolean hasLatest ;
83
82
84
83
public SwitchObserver (Observer <? super T > observer , SafeObservableSubscription parent ,
85
- MultipleAssignmentSubscription child ) {
84
+ SerialSubscription child ) {
86
85
this .observer = observer ;
87
86
this .parent = parent ;
88
87
this .child = child ;
0 commit comments