tokarev
tokarev

Reputation: 2635

How to use Play-mini within Akka microkernel?

I've read the blog post at letitcrash.com about Play-mini and Akka (this one) and just can't get my head around on how to use Play-mini inside Akka microkernel. Since there is no use of Global object, I need to turn on play-mini manually, right? The question is, how to do it?

Upvotes: 1

Views: 812

Answers (2)

tokarev
tokarev

Reputation: 2635

In order to start Play-mini, add the following to the boot class:

play.core.server.NettyServer.main(Array())

Kudos to Patrik Nordwall, who answered my question in Akka mailing list (here)

Upvotes: 1

poko
poko

Reputation: 258

The akka microkernel (akka->akka microkernel) is just a way to launch an akka actor system. If you decide to go with play-mini, then the setup is going to be akka->play mini, therefore you won't need a microkernel, just use your actors in your play mini application.

If you want to execute your actor system creation when the application is starting up, just add your bootstrapping code to the onStart() global event ie.

 object Global extends play.api.mini.Setup(com.example.App) {
   def onStart(): Unit = {
      //my actor bootstrapping code
   }
 }

The easiest way to get started with play mini is to use one of our g8 templates:

More information about play-mini:

Upvotes: 0

Related Questions