Re: Protocols.HTTP.Server.Request and streaming responses
Arne Goedeke <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
I usually ended up taking over the Stdio.File object and doing chunked encoding on top of that. Consider using WebSockets, it might be more convenient. arne On 08/13/14 16:17, Stephen R. van den Berg wrote: > Leveraging the NodeJS buzzword I find myself implementing a Node.pike > server (I'll contribute a framework for that) to fuel a brandnew > JavaScript-frontend-only website. > > Doing that I started with the simple HTTP server which is in > the distribution, which uses Protocols.HTTP.Server.Request > to respond to a request. This is all fine and dandy, but > I thought I'd ask if there is some magic incantation I'm overlooking > which allows me to return a streaming output? > > I.e. I talk JSON-RPC to and from the Node.pike, but some > of the queries result in really large database dumps, and hence > lots of json objects that need to be returned. I can ask the database > to give it to me piecemeal, but that doesn't really help if I then > need to assemble and flush it in one giant request->response_and_finish. > > If it's not possible now, no problem, I'll add it, just checking if I'm > not duplicating someone's work here. >