[Twisted-web] Concurrency in a twisted.web application
Ananda Tallur
anand at maunakeatech.com
Wed Nov 16 03:50:53 MST 2005
Dear twisted.web developpers and users,
I have written a twisted application for viewing and exporting movies.
These movies are in a format specific to my company.
I use : twisted 2.1.0, twisted.web 0.5.0, and nevow 0.5.0 (all html
templates are written using nevow).
In this web application, there is a feature for exporting a movie
file into mpeg, and sending it to the client web browser (file
download).
This feature is handled by a resource object which is a subclass of
static.File.
Exporting a movie into mpeg implies :
-> opening the original video file
-> doing the conversion (which can take as long as 1 minute or more)
-> sending the resulting mpeg file to the browser (file download)
The problem is that while the twisted web application is working
handling the export request, the twisted web server is not responsive
to any other HTTP request, as long as the video conversion and file
transfer is not finished.
I would like to know if there is a standard or recommanded way of
setting up concurrency into a twisted.web application.
And also if there is a sample program available somewhere.
I would like my web application to be still responsive to other HTTP
requests while :
-> file conversion to mpeg is being processing
-> mpeg file is being transfered to the client browser (which is
handled by a static.File subclass resource)
Thank you very much for all your answers.
I appreciate very much working with twisted.web and interested to get
more insight into the way twisted core handles requests.
Anand
More information about the Twisted-web
mailing list