Hi,
I am trying to figure out if it is possible to use an HTTP Akka Source as a
Source in a Graph DSL.
My main problem is how to reference the next element in the graph in the
akka route.
When you are not using it as a Source you can do the following:
private def route(someActor: ActorRef) =
post {
entity(as[String]) { message =>
someActor ! message
complete("")
}
}
Then you call Http().bind(...) but you need to pass an ActorRef to the
route().
However, I would like to do something like:
private def route() =
post {
entity(as[String]) { message =>
*nextElement* ! message
complete("")
}
}
val g = RunnableGraph.fromGraph(GraphDSL.create() { implicit builder:
GraphDSL.Builder[NotUsed] =>
import GraphDSL.Implicits._
val source = Http.bind(...)
val out = Sink.ignore
val f1 = Flow[Int].map(_ + "something")
in ~> f1 ~> out
ClosedShape
})
"nextElement" is what I am looking for. A way of pushing to the next
element in the graph.
Thanks,
Héctor.
--
>>>>>>>>>> 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.