【发布时间】:2016-12-14 09:05:51
【问题描述】:
value unsafePerformSync is not a member of scalaz.concurrent.Task[String]
[error] val x = task.unsafePerformSync
[error] ^
[error] one error found
如何解决上述(2.11.8)scalac错误?谢谢。
来自以下代码sn-p:
import org.http4s._, org.http4s.dsl._
import org.http4s.client.blaze._
import scalaz._, Scalaz._
import scalaz.concurrent.Task
object Client extends App {
val client = PooledHttp1Client()
val httpize = Uri.uri("http://httpize.herokuapp.com")
def post() = {
val req = Request(method = Method.POST, uri = httpize / "post").withBody("hello")
val task = client.expect[String](req)
val x = task.unsafePerformSync
println(x)
}
【问题讨论】:
-
这是哪个scalaz版本?