Created
August 15, 2013 13:10
-
-
Save smvv/6240717 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
fn spawn(&self, request: mongrel2::Request) { | |
let (_, callback) = self.routes[0]; // TODO: url routing | |
let (port, chan) : (Port<~str>, Chan<~str>) = stream(); | |
let env_request = request.clone(); | |
do spawn { | |
callback(~Env { | |
out_ch: &chan, | |
request: &env_request, | |
}); | |
} | |
let rep_body = port.recv(); | |
let headers = mongrel2::Headers(); | |
self.conn.reply_http(&request, 200u, "OK", headers, rep_body); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment