     fileprivate func enqueue(_ scheduler: ImmediateSchedulerType) -> Observable<Element> {
         return self
             // observe on is here because results should be cancelable
-            .observeOn(scheduler)
+            .observeOn(scheduler.async)
             // subscribe on is here because side-effects also need to be cancelable
             // (smooths out any glitches caused by start-cancel immediatelly)
-            .subscribeOn(scheduler)
-    }
-}
-
-extension SharedSequence where SharingStrategy == SignalSharingStrategy {
-    fileprivate func enqueue() -> Signal<Element> {
-        return self.asObservable()
-            // observe on is here because results should be cancelable
-            .observeOn(S.scheduler.async)
-            // subscribe on is here because side-effects also need to be cancelable
-            // (smooths out any glitches caused by start-cancel immediatelly)
-            .subscribeOn(S.scheduler.async)
-            .asSignal(onErrorSignalWith: Signal.empty())
+            .subscribeOn(scheduler.async)
     }
 }
 

    effects: @escaping (Control) -> Signal<Event>
) -> (Driver<State>) -> Signal<Event> {
    return { state in
        return state.map(query)
            .distinctUntilChanged { $0 != nil }
            .flatMapLatest { (control: Control?) -> Signal<Event> in
                guard let control = control else {
                    return Signal<Event>.empty()
                }

                return effects(control)
                    .enqueue()
        }
    }
}


    query: @escaping (State) -> Set<Control>,
    effects: @escaping (Control) -> Signal<Event>
    ) -> (Driver<State>) -> Signal<Event> {
    return { (state: Driver<State>) -> Signal<Event> in
        let observableSchedulerContext = ObservableSchedulerContext<State>(
            source: state.asObservable(),
            scheduler: Signal<Event>.SharingStrategy.scheduler.async
        )
        return react(query: query, effects: { effects($0).asObservable() })(observableSchedulerContext)
            .asSignal(onErrorSignalWith: .empty())
    }
}

