title: Akka Stream return object from Sink
body: <p>I've got a <code>SourceQueue</code>. When I offer an element to this I want it to pass through the <code>Stream</code> and when it reaches the <code>Sink</code> have the output returned to the code that offered this element (similar as <code>Sink.head</code> returns an element to the <code>RunnableGraph.run()</code> call).</p>
  
  <p>How do I achieve this? A simple example of my problem would be:</p>
  
  <pre><code>val source = Source.queue[String](100, OverflowStrategy.fail)
  val flow = Flow[String].map(element =&gt; s"Modified $element")
  val sink = Sink.ReturnTheStringSomehow
  val graph = source.via(flow).to(sink).run()
  
  val x = graph.offer("foo")
  println(x) // Output should be "Modified foo"
  val y = graph.offer("bar")
  println(y) // Output should be "Modified bar"
  val z = graph.offer("baz")
  println(z) // Output should be "Modified baz"
  </code></pre>
  
  <p><strong>Edit:</strong> For the example I have given in this question <strong>Vladimir Matveev</strong> provided the best answer. However, it should be noted that this solution only works if the elements are going into the <code>sink</code> in the same order they were offered to the <code>source</code>. If this cannot be guaranteed the order of the elements in the <code>sink</code> may differ and the outcome might be different from what is expected.</p>