Source.future vs Source.futureSource

Hi Akka Team,

I`m wondering which option is a better one to get source from future of http response:

          val httpResponse: Future[HttpResponse] = ???

          Source.future(httpResponse).flatMapConcat(_.entity.dataBytes) //1
          Source.futureSource(      //2

What i saw was that option 1 can produce warning messages:

java.util.concurrent.TimeoutException: Response entity was not subscribed after 1 second. ...

in case nobody pulls the source for some time.


As you say,

Source.futureSource is probably somewhat safer with regard to the subscription timeout hitting as it will materialize/subscribe to the given source immediately when the future completes, and then apply backpressure to it, while I think Source.future().flatMapConcat() will delay actually subscribing if there is backpressure.