On Wed, 2007-03-14 at 19:08 +0000, Henrik Lied wrote:
> Hi there!
> 
> I have a model which allows people to upload videos.
> In the save-method I run os.system("mencoder *variables"), which
> converts the uploaded video to a flash file.
> 
> I don't want the user to have to wait until the conversion is done
> before he can go on with his business. I've tried the Thread-module,
> but the current job still waits for the background process to finish..
> 
> Does anyone have a good idea (with a full example) on how I should go
> on? :-)

I'm not going to give you a full example, but this problem is raised
here fairly regularly (the most recent time being yesterday). The normal
solution is that the Django view queues the request to do the extra work
somewhere (e.g. a field in the model to say "needs encoding") and
another, external process comes along and does the work. The external
process might be triggered by a cronjob, for example -- it can check if
there is any work requests in the queue and handle them, otherwise just
exit immediately. The point is that the external process is not
triggered by a view or anything else that is tied to requests, so no
user's experience is affected.

Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to