gpt4 book ai didi

Scala Databinder Dispatch Http 关闭

转载 作者:行者123 更新时间:2023-12-04 18:21:08 26 4
gpt4 key购买 nike

为什么 http.shutdown() 没有停止程序?

这是例子:

package hello

import dispatch._, Defaults._
import scala.concurrent.Await
import scala.concurrent.duration._

object Main extends App {

val h = host("maps.googleapis.com")
val req = h / "maps" / "api" / "distancematrix" / "xml"
val params = req <<? Map("origins" -> "Berlin",
"destinations" -> "Warsaw",
"language" -> "pl")
val http = new Http
val ratioHttp: Future[xml.Elem] =
http(params OK as.xml.Elem)

println(Await.result(ratioHttp, 60.seconds))

http.shutdown()
}

最佳答案

Dispatch 版本有问题。 0.11.1 工作正常。

关于Scala Databinder Dispatch Http 关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24242238/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com