我正在关注调度文档中的第一个示例-
val svc = url("http://api.hostip.info/country.php")
val country = Http(svc OK as.String)
for (c <- country)
println(c)
我没有打印任何输出。当我将其更改为以下以进行阻塞调用时,我会得到输出。
val res = country()
println(res)
需要帮助。
完整程序-
import dispatch._
object DispatchTest {
def main(args: Array[String]) {
val svc = url("http://api.hostip.info/country.php")
val country = Http(svc OK as.String)
for (c <- country)
println(c)
}
}