node.js - express response with a callback -
node.js - express response with a callback -
is possible send response express, , wait homecoming response before continuing?
a typical scenario this
server sends request server b. server b processes request , sends server server b waits response server before continuing server farther processing of response server b , sends server b server b handles rest of processing required.
my understanding handled callbacks. in express expect
res.write('response', callback);
function callback() { //do stuff }
i don't see possible res.write method though. there method can utilize express functionality? i've never used socket.io
before, seems scenario websockets useful. wrong in assumption?
res.on('finish', callback);
is sent when lastly of info given os deal with.
http://nodejs.org/api/http.html#http_event_finish
if need know when client receives/processes data, however, client must send server, in case socket.io help.
node.js asynchronous express callback
Comments
Post a Comment