我有一个 scala 主课
object Job extends App {
def myProcedure() = {
sqlu"""CALL `dbName`.`update_history();"""
}
implicit val system: ActorSystem = ActorSystem()
implicit val mat: ActorMaterializer = ActorMaterializer()
implicit val ec = system.dispatcher
implicit val session: SlickSession = SlickSession.forConfig("my-mysql")
val proc = session.db.run(myProcedure))
val terminatedF = proc.flatMap { rec =>
println("value of the procedure ::" + rec)
session.close()
system.terminate()
}
Await.result(terminatedF, Duration.Inf)
println("terminated :::")
}
我看到的值rec
被打印出来,terminated :::
最后一行也被打印出来。然而程序并没有结束。我在这里错过了什么吗?