Skip to content

Instantly share code, notes, and snippets.

@fancellu
Created November 18, 2016 14:54
Show Gist options
  • Save fancellu/7eb753b6ad12339bbb1171b0b8744228 to your computer and use it in GitHub Desktop.
Save fancellu/7eb753b6ad12339bbb1171b0b8744228 to your computer and use it in GitHub Desktop.
Play 2.5/Akka/Guice, starting an actor before anything else
import actors.StartActorBrowser
import com.google.inject.AbstractModule
class Module extends AbstractModule {
def configure(): Unit = {
bind(classOf[StartActorBrowser]).asEagerSingleton()
}
}
class StartActorBrowser @Inject()(implicit val system: ActorSystem) {
println("StartActorBrowserImpl started")
// actor code here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment