Skip to content

Instantly share code, notes, and snippets.

@rossabaker
Created September 8, 2011 19:13
Show Gist options
  • Save rossabaker/1204391 to your computer and use it in GitHub Desktop.
Save rossabaker/1204391 to your computer and use it in GitHub Desktop.
object Server {
val handler: Request => Response
@tailrec
def apply(req: Request) = {
val res = handler(req)
res.send(socket)
if (!res.isInstanceOf[EndResponse]) {
apply(req)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment