Optimize flatMapConcat for single element source, #25241 (#25242)

* Optimize flatMapConcat for single element source, #25241

* Grab the SourceSingle via TraversalBuilder

* Also handle the case when there is no demand

* don't match when mapMaterializedValue and async
This commit is contained in:
Patrik Nordwall 2018-07-11 18:19:40 +02:00 committed by GitHub
parent 97490eb30c
commit d76b27ba3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 306 additions and 29 deletions

View file

@ -17,16 +17,17 @@ import akka.stream.{ Outlet, SourceShape, _ }
import akka.util.ConstantFun
import akka.{ Done, NotUsed }
import org.reactivestreams.{ Publisher, Subscriber }
import scala.annotation.tailrec
import scala.annotation.unchecked.uncheckedVariance
import scala.collection.immutable
import scala.concurrent.duration.FiniteDuration
import scala.concurrent.{ Future, Promise }
import akka.stream.stage.GraphStageWithMaterializedValue
import akka.stream.stage.GraphStageWithMaterializedValue
import scala.compat.java8.FutureConverters._
import akka.stream.impl.fusing.GraphStageModule
/**
* A `Source` is a set of stream processing steps that has one open output. It can comprise
* any number of internal sources and transformations that are wired together, or it can be