Mochabot log - CommonJS IRC channel: #commonjs on irc.freenode.net

2010-08-06:

[14:10] <ashb> the problem with ruby gems: http://github.com/dwilkie/foreigner/network
[17:31] <nrstott> kriszyp, am I reading http-clinet in promised-io correctly in that it seems that it buffers the entire response before resolivng the forEach promise so that you can't accoplish 'streaming'?
[17:32] <kriszyp> for the rhino version?
[17:32] <nrstott> the node version
[17:32] <nrstott> http://github.com/kriszyp/promised-io/blob/master/engines/node/lib/http-client.js
[17:33] <nrstott> im attemping to use it to write some JSGI middleware for proxying requests at the moment
[17:33] <kriszyp> it just buffers until it gets a forEach call. on line 64, it switches to directly piping to the forEach callback
[17:33] <kriszyp> it doesn't that so it doesn't miss any data between the request and the forEach call
[17:34] <nrstott> also... maybe this is cause of a node incompat, but im now getting this error:
[17:34] <nrstott> var statusLine = "HTTP/1.1 " + statusCode.toString() + " "
[17:34] <nrstott> that is saying statusCode cannot call method 'toString' of undefined
[17:34] <nrstott> but im sure that's my fault
[17:34] <nrstott> think i maybe need to update my version of jsgi-node...
[17:35] <kriszyp> are you returning a status?
[17:37] <nrstott> yeh i think im doing something wrong with my return here... im returning as my jsgi response a promise... and then the forEach insie of that response is a promise...
[17:38] <nrstott> i may be missing a status...
[17:38] <nrstott> i need to figure out a way to write these responses with promsies in a way thats easier to grok
[17:39] <nrstott> oh... duh i was using the jsgi client so i could just return a promise to client.request(proxyReq)
[17:39] <nrstott> thanks
[17:40] <nrstott> here is the start of my proxy middleware: http://gist.github.com/511701
[17:41] <nrstott> not sure if its appropraite to just use proxyReq.url = to or if i should try to be smarter
[17:41] <nrstott> think i have to be as that wont preserve querystrings
[17:43] <nrstott> i don't know if this is written already, but it would be really great to have a URL Parser that parsed to JSGI format packaged somewhere. If that exists, please let me know. If not I may make it sometime this week

 

 

Logs by date :