blob: ed9ff14807a9cd268d31d98e5f1f7e4a5f47b194 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
package io.crashbox.ci
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import scala.concurrent.duration.Duration
import scala.concurrent.{Await, ExecutionContext}
trait Core {
implicit val system: ActorSystem = ActorSystem("crashbox")
implicit val materializer = ActorMaterializer()
implicit val executionContext: ExecutionContext = system.dispatcher
val blockingDispatcher: ExecutionContext =
system.dispatchers.lookup("crashbox.blocking-dispatcher")
def log = system.log
def config = system.settings.config
sys.addShutdownHook {
log.info("Shutting down systm")
Await.ready(system.terminate(), Duration.Inf)
println("shutdown")
}
}
|