On 8/17/07, Derek Anderson <[EMAIL PROTECTED]> wrote: > this means 16 mailer threads (or 32, if two machines). but i only want > one mailer thread running at a time. (to avoid sending duplicate emails > during a race condition) but apache kills and restarts processes, so i > can't just randomly pick one. all processes must collude and elect one > and only process as "it". and they need to detect when the "it" thread > has died because apache killed it's parent process, and elect a new one.
Were I in your place, I'd do one of two things: * Look at a message broker like ActiveMQ (http://activemq.apache.org/) and run the sender process(es) as consumers on the queue. * Use a multi-process-safe queue and do the sending in-process. zc.queue (http://pypi.python.org/pypi/zc.queue) would probably be best for this. Jacob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---