Hi all,
I've started migrating the spray part of my app to akka-http.
In this app (an akka-cluster based system), I have an "administration"
HTTP REST interface, that runs an akka-http server.
In my system, all running actors have the possibility to register
"administration commands" to this internal server (this is basically an
actor). Each registered commands ends up as being a new route for the
http server that when triggered delegates to the registered actor.
Actually this is a bit more complex, because the actor that registers
its commands only registers it to the local http server, but we might
want to run this command by connecting to any node of the cluster (not
the one where the actor is running), so there's a distributed data based
system to share routes.
In short, most of the routes are dynamically inserted and removed, based
on actors that spawn (or stop) on nodes.
When porting this part to akka-http, I was wondering how I could model
this dynamic route system, since when calling:
Http().bindAndHandle(routes, address, port)
the `routes` parameter is a single Route, and as such the route itself
is not re-evaluated on each connection.
In Spray I was doing:
def receive = runRoute {
dynamic {
services.map(_.route).reduce((a,b) => a ~ b)
}
~
... static routes ...
}
I'm very unsure how I can migrate this part.
Thanks for any suggestions!
--
Brice Figureau <[email protected]>
--
>>>>>>>>>> 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.