我正在尝试从ControllerB(n)次执行Action,并返回结果。
class ControllerB extends ... {
def single = Action.async {
...
}
}
class ControllerA extends ... {
def multiple(rep: Long) = Action.async {
List.range(0,rep).foreach( Await(routes.ControllerB.single) ... ? )
Future(Ok("finished " + rep + " runs of function"))
}
}
我不确定应该如何编写Await部分。此外,如果还有一种方法可以使此Action异步。