3 ms·
Zed makes a big deal about getting long-polling for free, but with evented web servers (built on EventMachine, Node, Twisted, etc), you also get long-polling fo
by necubi 16y ago
Zed makes a big deal about getting long-polling for free, but with evented web servers (built on EventMachine, Node, Twisted, etc), you also get long-polling for free, since requests are just objects that get thrown around until they're completed. This architecture makes long-polling trivial, because when a request comes in you can put the request object into a hash or array, then when the data or computation you're waiting on finishes you look up the request and send it back to the client.
Regardless, there are a lot of interesting ideas here, and I look forward to playing around with it when it's more done.
- zedshaw 16y agoWell, this is long polling from any backend, not from within mongrel2. So your 0MQ handlers can respond to any connected HTTP or JSSocket, which other servers can do given the right design. However, what I was more referring to was that by using a state machine I didn't have to actually implement anything. I just wrote the code according to the state machine, and what fell out was a ton of features simply because of design serendipity.