[Grok-dev] Long running HTTP requests

Laurence Rowe l at lrowe.co.uk
Mon Mar 9 17:54:37 EDT 2009


Alec Munro wrote:
> Hi List,
> 
> I've put together a simple resource management app using REST, that
> allows a client to GET a url to request access to a resource. If the
> resource is busy, it returns 0, otherwise 1. They can POST to the same
> url to release the resource. I am considering changing it to simply
> hold the GET open until the resource is available, which could take
> several (<10) hours. Any idea if there would be a problem with this?
> 
> Thanks,
> Alec

This is difficult to implement with a ZODB based application, as MVCC 
ensures that you are insulted from any changes that happen after a 
transaction is started. You'll probably be better off with an event 
(rather than thread) based architecture, as you'll presumably have many 
simultaneously open connections. Maybe Twisted has something to offer here.

Laurence



More information about the Grok-dev mailing list