title: How can I use and return Source queue to caller without materializing it?
body: <p>I'm trying to use new Akka streams and wonder how I can use and return Source queue to caller without materializing it in my code ?</p>
  
  <p>Imagine we have library that makes number of async calls and returns results via <code>Source</code>. Function looks like this</p>
  
  <pre><code>def findArticlesByTitle(text: String): Source[String, SourceQueue[String]] = {
  
    val source = Source.queue[String](100, backpressure)
  
    source.mapMaterializedValue { case queue =&gt;
  
      val url = s"http://.....&amp;term=$text"
      httpclient.get(url).map(httpResponseToSprayJson[SearchResponse]).map { v =&gt;
        v.idlist.foreach { id =&gt;
          queue.offer(id)
        }
  
        queue.complete()
      }
    }
  
    source
  }
  </code></pre>
  
  <p>and caller might use it like this</p>
  
  <pre><code>// There is implicit ActorMaterializer somewhere
  val stream = plugin.findArticlesByTitle(title)
  val results = stream.runFold(List[String]())((result, article) =&gt; article :: result)
  </code></pre>
  
  <p>When I run this code within <code>mapMaterializedValue</code> is never executed. </p>
  
  <p>I can't understand why I don't have access to instance of <code>SourceQueue</code> if it should be up to caller to decide how to materialize the source.</p>
  
  <p>How should I implement this ?</p>