Skip to content

Instantly share code, notes, and snippets.

@koeninger
Created March 21, 2013 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koeninger/5216636 to your computer and use it in GitHub Desktop.
Save koeninger/5216636 to your computer and use it in GitHub Desktop.
async dispatch example
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)))
}
@kalexander
Copy link

this code is meh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment