Hi
I've written a Flow that make an http call like this
val connectionPool = Http().superPool[SubRequest](settings = poolConfig,
log = adapter)
val flow: Flow[SubRequest, Response, Unit] =
Flow[SubRequest]
.completionTimeout(1000 millis)
.map(subR => HttpRequest(HttpMethods.GET, subR.url) -> subR)
.via(connectionPool)
.map { r =>
val entity = r._1.get.entity.dataBytes.runWith(Sink.head)
val s = r._2.subResponse
new Response(s.id, s.price,s.isVideo, s.isDealIdBind, s.isRTB,
entity.map(content
=> content.toString()))
}
you can't see this but it's not compile the fact is that entity is a
Future[ByteString] so I can't extract the bytes from into the flow
I need to http call result entity not as Future but the real data.
Is there another way to use the akka-http client from inside a flow to get
the result of the Http call ?
Thanks
--
>>>>>>>>>> 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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.