Queue qsize = unreliable?

James R. Saker Jr. jsaker at americanrelay.com
Fri Aug 6 12:00:40 EDT 2004


Thanks Peter, Mike & Michael on qsize - had a hunch it might be
"reliable but not advisable" in the aspect of queue data changing. 

Perhaps there's an easier way to accomplish what I'm attempting. I've
got a syslogd receptor that needs to:

1. have a thread sit on port 514 and receive input via syslog protocol
from various sources

2. receive input and put into a queue (ideally a persistent object so if
the receptor gets rebooted while there's work in the queue, data isn't
lost. i like the idea of ZODB's Persistence class for this - thoughts?)

3. have a thread sit and look for data in the queue. when data is found,
parse it and fire it off using BEEP to an upstream collector.

I've done an initial version of this using Postgresql for an
intermediary (and twisted's database interface to deal with blocking
issues), but having to load Postgresql on a syslog2beep receptor is
overkill. A ZODB Queue implemented in a threaded app would seem the
right way to go. Any thoughts?

Jamie





More information about the Python-list mailing list