有没有什么简单的方法可以重复请求,直到在 Play2.1(scala)中获得成功结果?以及如何限制尝试次数?
我想做这样的事情:
WS.url("some.url").get().map{ response =>
val strval = someFunction(response)
strval match {
case "success" => println("do something after successful request")
case "error" => println("repeat same request until success - and repeat maximum N times!")
}
}
提前致谢!