@@ -6,7 +6,6 @@ import java.nio.file.NoSuchFileException
66import java .util .concurrent .ConcurrentHashMap
77import java .util .concurrent .TimeUnit
88
9- import scala .concurrent .Future
109import scala .concurrent .Promise
1110import scala .util .control .NonFatal
1211
@@ -22,15 +21,11 @@ import bloop.logging.DebugFilter
2221import bloop .task .Task
2322
2423import jsonrpc4s ._
25- import monix .execution .Ack
26- import monix .execution .Cancelable
2724import monix .execution .CancelablePromise
2825import monix .execution .Scheduler
2926import monix .execution .atomic .Atomic
3027import monix .reactive .Observable
31- import monix .reactive .Observer
3228import monix .reactive .OverflowStrategy
33- import monix .reactive .observers .Subscriber
3429import monix .reactive .subjects .BehaviorSubject
3530
3631object BspServer {
@@ -218,34 +213,4 @@ object BspServer {
218213 }
219214 }
220215
221- final class PumpOperator [A ](pumpTarget : Observer .Sync [A ], runningFuture : Cancelable )
222- extends Observable .Operator [A , A ] {
223- def apply (out : Subscriber [A ]): Subscriber [A ] =
224- new Subscriber [A ] { self =>
225- implicit val scheduler = out.scheduler
226- private [this ] val isActive = Atomic (true )
227-
228- def onNext (elem : A ): Future [Ack ] =
229- out.onNext(elem).syncOnContinue {
230- // Forward and ignore ack; safe because observer is sync
231- pumpTarget.onNext(elem)
232- ()
233- }
234-
235- def onComplete (): Unit = {
236- if (isActive.getAndSet(false ))
237- out.onComplete()
238- }
239-
240- def onError (ex : Throwable ): Unit = {
241- if (isActive.getAndSet(false )) {
242- // Complete instead of forwarding error so that completeL finishes
243- out.onComplete()
244- runningFuture.cancel()
245- } else {
246- scheduler.reportFailure(ex)
247- }
248- }
249- }
250- }
251216}
0 commit comments