Created
March 21, 2013 20:54
-
-
Save koeninger/5216636 to your computer and use it in GitHub Desktop.
async dispatch example
This file contains 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
import dispatch._ | |
import scala.util.Random | |
object AsyncExample { | |
val total = 2000000 | |
val groupSize = 100 | |
def svc = url("http://localhost:8080/") | |
def req(q: String) = Http(svc.addQueryParameter("q", q) OK as.String) | |
def res = Seq.fill(total)(Random.nextInt). | |
grouped(groupSize). | |
map(g => req(g.mkString.substring(1,groupSize))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this code is meh.