akka/akka-core

Remove FanoutProcessorImpl and friends

Open

#21.261 geöffnet am 23. Aug. 2016

Auf GitHub ansehen
 (8 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Scala (3.547 Forks)batch import
1 - triagedhelp wantedt:stream

Repository-Metriken

Stars
 (13.277 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T 19h) (10 gemergte PRs in 30 T)

Beschreibung

Implement it in terms of BroadcastHub instead (after https://github.com/akka/akka/pull/21183 merged). Implementation can be as simple as roughly:

object Sink {
...
  def asPublisher[T](fanout: Boolean): Sink[T, Publisher[T]] = {
     if (fanout) BroadcastHub.sink(bufferSize).mapMaterializedValue { src =>
        new Publisher {
            def subscribe(s: Subscriber): Unit = src.runWith(Sink.fromSubscriber(s))
        }
     }
  }
...
}

While this might be somewhat less efficient (although not sure!), it removes a rather ugly old class and its dependencies in one simple move.

Contributor Guide