medusa as win32 service

Robin Becker robin at jessikat.fsnet.co.uk
Mon Dec 1 05:30:15 EST 2003


In article <57de9986.0312010044.49f6430c at posting.google.com>, Giles
Brown <giles_brown at hotmail.com> writes
>Robin Becker <robin at jessikat.fsnet.co.uk> wrote in message news:<WnWU+VAnDjy$EwE
>P at jessikat.fsnet.co.uk>...
>> I wonder if this is the right way to write a medusa(asyncore) server
>> with the win32all framework. Other example services seem to create an
>> event to pass the stop signal from SvcStop into a separate termination
>> method, but I'm unsure how that would mix with the polling loop. 
>> 
>> This simple framework seems to start and stop OK, but I wonder if I'm
>> missing some obvious race or something.
>
>I think the cleanest design for this is to use the
>medusa.threading.select_trigger function to send an asyncore.ExitNow
>exception into the main select loop.  The only problem with this is
>that the current medusa.threading.select_trigger (in the sourceforge
>medusa version) catches (and does not re-raise) this exception.  I've
>modified our code so that it does not catch it and this seems to work
>very well (we have a web server using medusa that runs as a service).
>
>Regards,
>Giles Brown
well it is an opensource project, so perhaps you could submit patches.
I'm not sure how much work A Kuchling would/could devote to it. I also
have made some relatively trivial changes to the status extension, but
they don't affect very much. 
-- 
Robin Becker




More information about the Python-list mailing list