lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi everyone. I'm posting this question in behalf of a co-worker.
We've a webserver based heavily on Xavante, using wsapi. On certain http requests, we want to issue another http request to a different server, and send that response back. The thing is that we need to send the response by chunks, i.e. we get a chunk from the other server, process it, send it back to the client, get another chunk, etc.
So, we are using socket.http.
http.response{ blah, blah, theSink }

theSink returns a function to be used as a pump. each time luasocket gets some data, it calls that function. However, we need to yield there (that's the way wsapi works) but we can't because the pump is called by a metamethod.

Is there a workaround available besides not using socket.http and issuing the request by hand? I thought of giving coxpcall a try, but I think that it solves a completely different problem.

Regards,
Ignacio Burgueño