nogradi at gmail.com
Sat Feb 11 17:58:16 EST 2006
> >>> Anyway, I have the feeling that there must be a more sane and > >>> probably > >>> safe way of achieving what I would like by a much simpler method. > >>> > >>> Any ideas? > >> > >> A quick one. > >> > >> Run a small separate daemon process which embeds an XML-RPC > >> server and have your web pages use XML-RPC to call that daemon > >> process to trigger off the task. The daemon process can still fork > >> exec > >> as necessary. > >> > >> This way you eliminate a fork in Apache child process which may be > >> problematic because of the socket connections etc that are inherited. > > > > Well, that still looks like to me that I'm shooting a bird with a > > cannon. The reason is that I need to do something really simple: users > > upload a zip file (remember my questions about the zipfile module? :)) > > and should get an acknowledgement that the upload was successful. The > > server should start unpacking the archive, check if the files are okay > > and move them to a directory. All of this can take quite long, so the > > acknowledgement should be sent before this unpacking/checking/moving > > finishes. > > The suggestion I gave wouldn't preclude an acknowledgement being > sent before the unpacking begins. > > Have you simply considered using a separate thread to do the unpacking? Hmmmmm, what do you mean exactly? When I do an os.fork the whole apache forks, you mean that I should start a brand new thread, outside of apache?