Hi all,
I'm creating a small project using Akka Http and I'm creating an Actor
System for it, as per documentation.
In this project, I'm also using another lib (rediscala) that requires an
Actor System instance as well. So, more or less like this:
MyRest.scala
trait MyRest extends MyJsonProtocol {
val route: Route = ...
MyRepository.dosomething(..)
MyRepository.scala
object MyRepository {
implicit val system = ActorSystem("repository-system")
val redis = RedisClient()
...
MyAppServer.scala
object MyAppServer extends App with MyRest {
implicit val system = ActorSystem("my-system")
implicit val materializer = ActorMaterializer()
implicit val executionContext = system.dispatcher
val bindingFuture = Http().bindAndHandle(route, "localhost", 8080)
println(s"The server is ready to handle HTTP requests")
StdIn.readLine
bindingFuture
.flatMap(_.unbind())
.onComplete(_ => system.terminate())
}
In this situation 2 actor systems are being created, one for Akka Http and
one for RedisClient. I'm aware ActorSystem is a heavy object to be created,
so I'm wondering if there's some alternate approach/pattern of this is OK.
Thanks and regards,
Luciano
--
>>>>>>>>>> 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.