3
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錯誤?謝謝。value unsafePerformSync不是scalaz.concurrent.Task的成員[String]
從下面的代碼片斷:
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版本? – rethab