Created
June 10, 2015 01:46
-
-
Save Errorific/dfd2c2d64a94008d11ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.basicproject | |
import org.http4s.Request | |
import org.http4s.Method | |
import org.http4s.Headers | |
import org.http4s.Header | |
import org.http4s.Http4s._ | |
import scalaz.concurrent.Task | |
object HelloWorld { | |
def main(args: Array[String]) { | |
while(true) { | |
val start = System.currentTimeMillis | |
println(u.run.take(100)) | |
val finish = System.currentTimeMillis | |
println("time " + (finish - start)) | |
} | |
} | |
val client = org.http4s.client.blaze.PooledHttp1Client() | |
val r: Request = new Request( | |
method = Method.GET, | |
uri = uri("https://api.github.com/gists/933d379288cb22d7cd03"), | |
headers = Headers( | |
Header("Content-Type", "application/json") | |
) | |
) | |
val u: Task[String] = client(r).as[String] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment