Commit 6208b3d9 authored by Szabolcs Gyurko's avatar Szabolcs Gyurko
Browse files

Changed actorsystem to be injected

parent 5ae0f6eb
......@@ -14,11 +14,10 @@ import scala.concurrent.duration.Duration
* Created by sgyurko on 31/08/2016.
class SGet2 @Inject() (val dbConfigProvider: DatabaseConfigProvider) {
class SGet2 @Inject() (val dbConfigProvider: DatabaseConfigProvider, val actorSystem: ActorSystem) {
private val eventBus = new SGet2EventBus
private val dbConfig = dbConfigProvider.get[JdbcProfile]
val downloadQueue = new DownloadQueue(this, dbConfigProvider)
var actorSystem: ActorSystem = _
import dbConfig.driver.api._
......@@ -2,11 +2,12 @@ package sget2
import javax.inject.{Inject, Named, Singleton}
import{ActorRef, ActorSystem}
import play.api.Logger
import play.api.inject.ApplicationLifecycle
import scala.concurrent.Future
* Created by sgyurko on 31/08/2016.
......@@ -18,14 +19,11 @@ class SGet2Startup @Inject() (private val sget2: SGet2, val lifecycle: Applicati"Starting SGet2")
sget2.actorSystem = ActorSystem.create("SGet2")
lifecycle.addStopHook(() {
lifecycle.addStopHook(() Future {"Stopping SGet2")
/* load() will return a future. We will execute start() asynchronously once load() redeems */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment