3
value unsafePerformSync is not a member of scalaz.concurrent.Task[String]
[error] val x = task.unsafePerformSync
[error] ^
[error] one error found
scalaz.concurrent.Taskのメンバーではないでしょうか?ありがとう。次のコードスニペットから値unsafePerformSyncは、上記(2.11.8)scalacエラーを解決する方法[文字列]
:
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)
}
これはどちらですか? – rethab