title: Akka Stream - Source.fromPublisher
body: <p>I'm trying to execute the following code based on the akka stream quick start guide:</p>
  
  <pre><code>implicit val system = ActorSystem("QuickStart")
  implicit val materializer = ActorMaterializer()
  
  val songs = Source.fromPublisher(SongsService.stream)
  
  val count: Flow[Song, Int, NotUsed] = Flow[Song].map(_ =&gt; 1)
  
  val sumSink: Sink[Int, Future[Int]] = Sink.fold[Int, Int](0)(_ + _)
  
  val counterGraph: RunnableGraph[Future[Int]] =
    songs
      .via(count)
      .toMat(sumSink)(Keep.right)
  
  val sum: Future[Int] = counterGraph.run()
  
  sum.foreach(c =&gt; println(s"Total songs processed: $c"))
  </code></pre>
  
  <p>The problem here is that the future never return a result. The biggest difference from the documentation example is my Source.</p>
  
  <p>I have a play enumerator, which I'm converting it to an Akka Publisher, resulting in this SongsService.stream</p>
  
  <p>When using a defined list as a Source like:</p>
  
  <pre><code>val songs = Source(list)
  </code></pre>
  
  <p>It works, but using the Source.fromPublisher does not.</p>
  
  <p>But the problem here is not the publisher indeed, I can do a simple operation and it works:</p>
  
  <pre><code>val songs = Source.fromPublisher(SongsService.stream)
  songs.runForeach(println)
  </code></pre>
  
  <p>It goes through the database, create the play enumerator, convert it to a publisher and I can iterate over.</p>
  
  <p>Any ideas?</p>