In researching how to do this I came across akka.stream.io.OutputStreamSink
which is exactly what I
need:
https://github.com/akka/akka/blob/releasing-akka-stream-and-http-experimental-1.0-RC3/akka-stream/src/main/scala/akka/stream/io/OutputStreamSink.scala
The code snippet is very simple:
val outputStream: () => OutputStream = { () => {
val pipedOutputStream = new PipedOutputStream()
//do something with the piped output stream, like connect it to a read
stream
//return for later
pipedOutputStream
}
//somewhere else, maybe in a route:
akkaHttpRequest.entity.getDataBytes.runWith(OutputStreamSink(outputStream),
flow)
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.